UCM with polar coordinates
This activity belongs to the GeoGebra book The Domain of the Time.
In the previous activity, the slider anima moved point M using the instruction:
SetValue(M, Rotate(M, dt ω, O))
Instead of using the Rotate command, we can use polar coordinates. Let's see how.
In the Cartesian coordinates of a point P(x, y), the coordinates x and y represent, respectively, the distances (with their signs) horizontally and vertically from point P to the origin O.
In polar coordinates P(r ; α), r corresponds to the length of the segment OP and α corresponds to the angle, between 0º and 360º, that segment OP makes with the X-axis. Note that, to avoid confusion, we use a semicolon to separate the polar coordinates instead of a comma. For example, the point P(0, −3) is equal to P(3; 270°).
Para obtener las coordenadas cartesianas de un punto P, GeoGebra usa x(P) e y(P). Para obtener sus coordenadas polares, GeoGebra usa abs(P) y arg(P).
To obtain the Cartesian coordinates of point P, GeoGebra uses x(P) and y(P). To obtain its polar coordinates, GeoGebra uses abs(P) and arg(P).
- Note: In reality, arg(P) returns an angle between −180º and 180º, with negative values corresponding to angles greater than 180º.
SCRIPT FOR SLIDER anima
# Calculate the elapsed seconds dt; add one second if t1(1) < tt
SetValue(tt, t1(1))
SetValue(t1, First(GetTime(), 3))
SetValue(dt, (t1(1) < tt) + (t1(1) − tt)/1000)
# Register the lap time and the number of laps completed
SetValue(reg, If(arg(M − O) < 0 ∧ arg(M − O) + dt ω ≥ 0, Append(t, reg), reg))
SetValue(laps, If(arg(M − O) < 0 ∧ arg(M − O) + dt ω ≥ 0, laps+ 1, laps))
# Move M
SetValue(M, O + (r; t ω))
Author of the activity and GeoGebra construction: Rafael Losada.