# 5.1 Phy1020: brief trigonometry tutorial  (Page 3/20)

 Page 3 / 20

Output for script in Listing 1

When you open the file in your browser, the text shown in Figure 1 should be displayed in the browser window.

Figure 1 . Output for script in Listing 1.
```degrees = 90 : radians = 1.5707963267948965 radians = 1 : degrees = 57.29577951308232radians = 3.141592653589793 : degrees = 180```

Because it will frequently be necessary for us to convert between degrees and radians, I decided to write two functions that we will use to make those conversions. Thatwill eliminate the need for us to stop and think about the conversion (and possibly get it backwards) when writingcode. We will simply call the function that performs the conversion in the required direction.

The toRadians function expects to receive an input parameter describing an angle in degreesand returns the value for that same angle in radians.

The toDegrees function expects to receive an input parameter describing an angle in radiansand returns the value for that same angle in degrees.

Global variables named degrees and radians

The code in Listing 1 begins by declaring global variables named degrees and radians . The variable named degrees is initialized to 90 degrees.

The toRadians function is called to convert that value of degrees to radians. The returned value in radians is stored in the variable named radians .

Display contents of both variables

Then the document.write method is called to display the values contained in both variables, producing the first line of output text shown in Figure 1 .

Modify variable contents, convert, and display again

Following that, a value of 1 is assigned to the variable named radians . The toDegrees function is called to convert that value to degrees, and the result is stored in the variable named degrees .

Once again, the document.write method is called to display the current contents of both variables, producing the second line of output textshown in Figure 1 .

One more time

Finally, the mathematical constant, PI, is stored in the variable named radians . Then that value is converted to degrees and stored in thevariable named degrees . The current values in both variables are displayed, producing the last line of output text shown in Figure1.

And the results were...

As you can see from Figure 1 ,

• Ninety degrees is equal to 1.57 radians
• One radian is equal to 57.296 degrees
• 3.14 (PI) radians is equal to 180 degrees

A template

You might want to save your html file as a template for use with future exercises that require conversions between radians and degrees. This will beparticularly useful when we write scripts that use JavaScript's built-in trigonometric methods. Those methods deal with angles almost exclusively inradians while we tend to think of angles in degrees. We will use these two functions to perform conversions between degrees and radians whenrequired.

## Sine, cosine, and tangent

An exercise involving a right triangle

For the next exercise, I would like for you to create a right triangle on your graph board by placing pushpins at the following coordinates:

are nano particles real
yeah
Joseph
Hello, if I study Physics teacher in bachelor, can I study Nanotechnology in master?
no can't
Lohitha
where we get a research paper on Nano chemistry....?
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
has a lot of application modern world
Kamaluddeen
yes
narayan
what is variations in raman spectra for nanomaterials
ya I also want to know the raman spectra
Bhagvanji
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!