7. Exercises 2

Exercises working with number functions.

Exercises:

  1. hypotenuse: Given the lengths of two legs of a right triangle, return the length of the third side.

  2. 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.)

  3. distance: Given the x and y coordinates of two points (x1,y1) and (x2,y2), find the distance between them.

  4. quadratic-1: Given a, b, and c, find one solution to the equation a x^2+b x + c = 0.

  5. quadratic-2: Given a, b, and c, find the other solution to a x^2+b x + c = 0.

  6. 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.

Last modified August 18, 2023: 2022-2023 End State (7352e87)