.geometry "version 0.2";
t = .script(0.000000, 1.000000, 0.003000);
//t = .f.rpn(0.050000, .green);
ang = .f.rpn(t, 360.000000, .mul, 36.000000, .add, "\theta");
v1 = .free(0, 0, .invisible, "1");
v2 = .free(0.4775, 0.115, .invisible, "2");
c1 = .c.vv(v1, v2);
l1 = .l.vv(v1, v2, .invisible);
rad = .f.vv(v1, v2);
x = .f.rpn(ang, .cos, rad, .mul);
y = .f.rpn(ang, .sin, rad, .mul);
vmove = .v.ff(x, y);
vzero = .v.ff(rad, 0.000000);
Ang = .a.vvv(vzero, v1, vmove, "\theta");
lorig = .l.vv(v1, vzero, .longline);
lang = .l.vv(vmove, v1, "1.0");
l2 = .l.vlperp(vmove, lorig, .invisible);
v3 = .v.ll(l2, lorig, .invisible);
l3 = .l.vv(vmove, v3, .green, "sin \theta");
rsin = .f.rpn(Ang, .sin, "sin \theta");
rcos = .f.rpn(Ang, .cos, "cos \theta");
rtan = .f.rpn(Ang, .tan, "tan \theta");
rcot = .f.rpn(1.000000, Ang, .tan, .div, "cot \theta");
rsec = .f.rpn(1.000000, Ang, .cos, .div, "sec \theta");
rcsc = .f.rpn(1.000000, Ang, .sin, .div, "csc \theta");
l4 = .l.vv(v3, v1, .invisible);
l5 = .l.vlperp(vmove, lang, .invisible);
v4 = .v.ll(l5, lorig, .invisible);
l6 = .l.vv(vmove, v4, .magenta, "tan \theta");
l7 = .l.vlperp(v1, lorig, .longline);
v5 = .v.ll(l6, l7, .invisible);
l8 = .l.vv(v5, vmove, .cyan, "cot \theta");
l9 = .l.vlperp(vmove, l7, .invisible);
v6 = .v.ll(l9, l7, .invisible);
l10 = .l.vv(vmove, v6, .red, "cos \theta");
l11 = .l.vv(v1, v4, .yellow, "sec \theta");
l12 = .l.vv(v1, v5, .blue, "csc \theta");
.text("The Trigonometric Functions", .red);
.text("This illustrates the geometric significance of the
trigonometric functions sine, cosine, tangent, cotangent,
secant, and cosecant.  The circle in the diagram has
radius equal to 1.0.  Press the 'Run Script' button
for a dynamic demonstration.");
