<< Chapter < Page Chapter >> Page >

SVG code to draw a circle

Listing 15 shows the SVG code produced by the Java code in Listing 14 .

Listing 15 . SVG code to draw a circle.
<circle fill="none" stroke="black" stroke-width="1" cx="725" cy="355" r="41"><title>circle</title></circle>

By now, you should see the pattern and there should be no need to explain the relationship between the attributes of the circle element and the parametervalues in the call to the makeCircle method in Listing 14 .

Draw more lines

The earlier section titled What does the image show describes how three cords are used to tie the masses to one another and to tie the leftmost mass to the wall. This is accomplished using the fourcalls to the Java makeLine method shown in Listing 16 .

Listing 16 . Draw more lines.
//Draw cord from wall to Mass C Element cordR = SvgLib21.makeLine(svg,ns, "line",1.0, 5.0,2, 5.0); //Draw cord from Mass C to Mass BElement cordQ = SvgLib21.makeLine(svg, ns,"line", 4.0,5.0, 5.0,5.0 );//Draw cord from Mass B to the top of the pulley. Element cordP1 = SvgLib21.makeLine(svg,ns, "line",7.0, 5.0,8.05, 5.0); //Draw the cord from the right side of the pulley to// Mass A Element cordP2 = SvgLib21.makeLine(svg,ns,"line", 8.5,4.5, 8.5,2.5 );

There is nothing new in Listing 16 .

SVG code to draw more lines

The Java code in Listing 16 produces the SVG code shown in Listing 17 .

Listing 17 . SVG code to draw more lines.
<line stroke="black" stroke-width="1" x1="90" y1="315" x2="180" y2="315"><title>line</title></line><line stroke="black" stroke-width="1" x1="360" y1="315" x2="450" y2="315"><title>line</title></line><line stroke="black" stroke-width="1" x1="630" y1="315" x2="725" y2="315"><title>line</title></line><line stroke="black" stroke-width="1" x1="765" y1="360" x2="765" y2="540"><title>line</title></line>

There is also nothing new in Listing 17 .

Change line thicknesses

With the exception of text to be discussed shortly, we have now created an element for every object that we need in our drawing.

As you may have noticed, the value of the stroke-width attribute for every element created so far has been "1". That is the defaultvalue. We may not be satisfied with that default value in all cases. We may prefer that some of the lines that describe the geometrical objects be thicker than linesthat describe other geometrical objects.

My SVG graphics library provides a method named setStrokeWidth that we can use to adjust the stroke-width attribute values for an elementbefore the final output SVG file is written. (As you will see if you examine Listing 27 , the library provides methods that let you adjust other attribute values as well.)

Questions & Answers

is economics important in programming world?
Abdul Reply
What is oppunity cost
Kudzanayi Reply
it refers wants that are left unsatisfied in Oder satisfy another more pressing need
Thank bro
is the second altenative to foregone
How does monopoly and imperfect competion;public goods externalities ass symmetric information, ommon property ressourses; income distribution Merit goods and Macroeconomic growth and stability causes market failure?
it is where by a labour moves from one place to another
Amoako Reply
what is mobility of labour
George Reply
who best defined economics
paul Reply
what are the importance of economics
Adwoa Reply
trade should be best
help to know how our government operates in which system
1. To solve economic problems. 2. To predict economic event. 3. It also offer intellectual training to students.
How price elasticity can affect the markets of certain goods
Rhoda Reply
Heyy thanks for the teaching
Easter Reply
what is labour
Arthur Reply
Mental and physical ability of human being is considered as labour.
and usually provided by human
is all human effort both physical and mental abilities to work
why is it that most countries in Africa abuse available resources
Okeoghene Reply
What is economics
Bright Reply
economics is a science which studies human behaviour as a relationship between ends, scarce means which have alternative uses.
Why is scarcity a mind problem in economics
Alima Reply
because of the problem of allocation of resources
unequalled distribution of resources
scarcity is a mind problem due to circumstances like when a particular product is demand in a high rate at the market.
scarcity defines limited in supply relative to the demand them. so scarcity is a mind problem in economics because wants are unlimited while resources are also limited.
it is a mind problem because it's one of the fundamental issue address by economics human wants are unlimited and resources available are limited this makes the study of economics essential
its a fundamental issue
it's not a mind problem, I think it's a economic problem, how to allocate scarce resources to satisfy need and want of society
Identify the different sectors in the economy
Moses Reply
what is economics
economic is study of human behaviour according to how they satisfie their numerous want
Economics is a science which studies human behaviour as a relationship between ends and scares resources.
economic is study of human behaviour according to how they satisfie their numerous want
what is the law of demand
Adugbire Reply
the lower the price the higher the quantity demanded vice versa is true
yes ooh
what are relationship between unemployment and economic growth
Weness Reply
no relationship
When there is economic growth, there is increased opportunity in employment. When there is no economic growth mean there is recession causing a decline or downsizing in employment opportunities.
unemployment or employment determined by the level of economic growth
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Accessible physics concepts for blind students. OpenStax CNX. Oct 02, 2015 Download for free at https://legacy.cnx.org/content/col11294/1.36
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Accessible physics concepts for blind students' conversation and receive update notifications?