This command calculates the sine of an angle.
x = sin(y)
x | The sine of angle y . Angle y is in radians. |
Please see Chapter 5 for an explanation of the sine function. The sine is used to find the vertical speed of an object that is moving up at an angle, such as an aircraft climbing.
The following code sends the angle of roll about the y-axis to the screen; this is controlled with the left and right arrow keys. The program prints the angle and sine of the angle to the screen.
oworld = New World(); ocamera = New Camera(oworld); sphere = oworld.CreateSphere(50,50,50,25,25); ocamera.MoveBack(1200); sphere.Walk(); //Loop While(TRUE) { z = sphere.getyangle(); Y = sin(z); SetText(yangle + z + sin + y); }