R uses radiant as input for trigonometric functions.

1 2 3 4 5 6 7 |
# calculating rad pi/2 90*pi/180 # transforming degree into radiant degr<-c(0:360) degr rad<-grad*(pi/180) rad |

Now we can plot the function.

1 2 |
sin(rad) plot(sin(rad)) |

And by playing with the functions we get a funny graphic output.

1 2 3 4 5 6 7 8 9 |
plot(asin(sin(rad))) plot(asin(sin(rad)),type="l") points(sin(rad)) points(sin(rad)*-1,col="green") lines(asin(sin(rad))*-1) lines(1/sin(rad),col="red") lines(1/sin(rad)*-1,col="blue") points(x=91,y=0) points(x=271,y=0) |

And if we include the tangent, the graphic looks like this:

1 2 3 4 5 6 7 |
tan(rad) tangens <- tan(rad) tangens[91]<-0 tangens[271]<-0 plot(tangens,type="l") lines(sin(rad),type="l",col="red") lines(cos(rad),type="l",col="green") |

1 2 3 4 5 |
lines(tangens,type="l",col="red") lines(1/tangens,type="l",col="green") # dividing by 10 for visual reasons lines(tangens/10,type="l",col="red") lines(1/tangens/10,type="l",col="green") |

1 2 3 4 |
plot(tangens,type="l") lines(1/tangens,type="l") plot(tangens,type="l") lines(1/tangens,type="l",col="green") |