7. Exercises 2
Exercises:
-
hypotenuse
: Given the lengths of two legs of a right triangle, return the length of the third side. -
slope
: Given the x and y coordinates of two points (x1,y1) and (x2,y2) - in that order - return the slope of the line between those points. (OK if it does not work for vertical lines.) -
distance
: Given the x and y coordinates of two points (x1,y1) and (x2,y2), find the distance between them. -
quadratic-1
: Given a, b, and c, find one solution to the equationa x^2+b x + c = 0
. -
quadratic-2
: Given a, b, and c, find the other solution toa x^2+b x + c = 0
. -
Make an animation with a number model. Use the number to control the current amount of rotation of the object. The tick handler makes the object spin. Moving the mouse causes the animation to spin faster. Make hitting a key reset the position to zero.