This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
arucker90
wrote ...
2011/10/12
computing sine and cosine in greenfoot
arucker90
2011/10/12
#
I'm trying to set my variable (double) xVelocity to equal speed * cosine (angle) where speed and angle are declared variables. How do i enter that into greenfoot?
mjrb4
2011/10/12
#
You can use Math.cos and Math.sin:
xVelocity = speed*Math.cos(angle);
...similar with sine.
Kartoffelbrot
2013/4/14
#
Thank you, too.
You need to login to post a reply.
X