<< Chapter < Page Chapter >> Page >
Figure 2 . Screen output for Listing #2.
r =10, C = 62.83185307179586 r =20, C = 125.66370614359172r =15, C = 94.24777960769379

Figure 2 shows the value of the circumference for three different values for the radius. You should be able to confirm that the combination of thethree lines of output text satisfy the proportionality rules stated earlier .

For example, you can confirm these results by entering the following three expressions in the Google search box and recording the results that appearimmediately below the search box:

2*pi*10

2*pi*20

2*pi*15

Area of a circle

Before I can discuss the area of a circle, I need to define a symbol that we can use toindicate exponentiation.

A symbol for exponentiation

Physics textbooks typically use a superscript character to indicate that a value is raised to a power, such as the radius of a circle squared.

Superscripts may or may not be in the vocabulary of screen readers, but probably are not compatible with Braille displays. Therefore, we need asymbol that is compatible with both.

When I need to indicate that a value is raised to a power, I will use the "^" character, such as in the following text that indicates radius squared,or radius raised to the second power.

radius^2

In those cases where the exponent is a fraction, or is negative, I will surround it withparentheses, such as in

radius^(1/2), and

distance^(-2)

The first term indicates the square root of the radius. The second term indicates that distance is being raised to the -2 power.

I chose to use the "^" character to indicate exponentiation because it is used as the exponentiation operator in some programming languages, such asBASIC. The "^" character is also recognized by the Google calculator as an exponentiation operator.

Unfortunately, there is no exponentiation operator in JavaScript, so we will need a different approach to raise a value to a power in ourJavaScript scripts. As you will see later, we will use the built-in Math.pow method for that purpose.

An expression for the area of a circle

From earlier courses, you should know that the area of a circle is given by

A = PI * r^2

where

  • A is the area.
  • PI is the mathematical constant 3.14159...
  • r is the radius of the circle.

Proportional to the square of the radius

From this, we can conclude that the area of a circle is not proportional to the radius. Instead, it is proportional to the square of the radius as in

A $ r^2

If you change the radius...

If you change the value of the radius, the area changes in proportion to the square of the radius. If the radius doubles, the area increases by four. If theradius is decreased by 25-percent, the area decreases by more than 25-percent. This is illustrated by the script in Listing 3.

Listing 3 . Area is proportional to radius squared.
<!-- File JavaScript03.html --><html><body><script language="JavaScript1.3">var r = 10 var A = Math.PI * Math.pow(r,2)document.write("r =" + r + ", A = " + A + "</br>") //Multiply r by 2. Then display r and Cr = r * 2 var A = Math.PI * Math.pow(r,2)document.write("r =" + r + ", A = " + A + "</br>")//Reduce r by 25%, Then display r and C r = r * (1 - 25/100)var A = Math.PI * Math.pow(r,2) document.write("r =" + r +", A = " + A + "</br>")//Compute and the display the cube root // of a number.var X = Math.pow(8,1/3) document.write("Cube root of 8 = " + X)</script></body></html>

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask