方向餘弦
Author: 藍邦偉  老師

x

y

z

顯示xy平面

顯示單位向量

x

y

z

$P$

cosγ

cosα

cosβ

顯示座標軸

1

2

3

,

,

)

$ x $

$ y $

$ z $

$ O $

$ 點P\;($

A: (x((Corner[3] + 39 * Corner[4]) / 40), y((Corner[1] + 9 * Corner[4]) / 10))
B: (x((4 * Corner[3] + 16 * Corner[4]) / 20), y((Corner[1] + 9 * Corner[4]) / 10))
a = Segment(A, B)
C: (3 * A + B) / 4
D: (3 * B + A) / 4
E = Point(a)
c = Circle(C, E)
c' = Translate(c, Vector[C, D])
A' = Rotate(A, 270*°, C)
B' = Rotate(B, 270*°, C)
a' = Segment(A', B')
c'' = Rotate(c', 270*°, C)
D' = Rotate(D, 270*°, C)
E' = Rotate(Translate[E, Vector[C, D]], 90*°, D)
E'' = Rotate(E', 270*°, C)
F = Point(c'')
G = Point(c')
α = Angle(E'', D', F)
b = Segment(D', F)
d = Segment(D, G)
β = Angle(G, D, E')
I: C + (b * cos(α), b * sin(α) * sin(β))
J: C + (b * cos(α + 90°), b * sin(α + 90°) * sin(β))
K: C + (0, b * cos(β))
e = Segment(C, K)
f = Segment(C, I)
g = Segment(C, J)
O = (1.2119828673288051, -0.8286457422639326)
I' = Translate(I, Vector[C, O])
J' = Translate(J, Vector[C, O])
K' = Translate(K, Vector[C, O])
L = 8 (slider from 1 to 10, step 1)
I'' = Dilate(I', L, O)
J'' = Dilate(J', L, O)
K'' = Dilate(K', L, O)
I''' = Dilate(I'', -1, O)
J''' = Dilate(J'', -1, O)
K''' = Dilate(K'', -1, O)
u' = Vector(I''', I'')
v' = Vector(J''', J'')
w' = Vector(K''', K'')
h = Segment(D', E'')
i = Segment(D, E')
軌跡1 = Locus(I, F)
L_{axis}: L
j = false
w = Vector(O, K')
u = Vector(O, I')
v = Vector(O, J')
k = false
list1 = Sequence(CurveCartesian[x(O + t * u + s * v), y(O + t * u + s * v), t, -L, L], s, -L, L, 1)
list2 = Sequence(CurveCartesian[x(O + t * u + s * v), y(O + t * u + s * v), s, -L, L], t, -L, L, 1)
m = 5 (slider from -6 to 6, step 1)
n = 4 (slider from -6 to 6, step 1)
o = 6 (slider from -6 to 6, step 1)
P: O + m * u + n * v + o * w
P_1: O + m * u
P_2: O + n * v
P_3: O + o * w
P_4: O + m * u + n * v
P_5: O + n * v + o * w
P_6: O + m * u + o * w
p = Segment(P, P_4)
q = Segment(P, P_5)
r = Segment(P, P_6)
s = Segment(P_6, P_3)
t = Segment(P_5, P_3)
a_1 = Segment(P_5, P_2)
b_1 = Segment(P_6, P_1)
c_1 = Segment(P_4, P_2)
d_1 = Segment(P_4, P_1)
e_1 = Segment(P_1, O)
f_1 = Segment(O, P_2)
g_1 = Segment(P_3, O)
h_1 = Segment(P, O)
i_1 = Segment(P, P_2)
k_1 = Segment(P, P_1)
Poly1, p_2, o_1, p_1 = Polygon(O, P, P_2)
Poly2, p_3, p_4, o_2 = Polygon(P, O, P_1)
Poly3, o_3, p_5, p_6 = Polygon(P_3, P, O)
j_1 = Segment(O, P_3)
m_1 = Segment(P, P_3)
n_1 = false
z = true
l_1 = false
l = true
inputBox1 = Textfield(m)
inputBox2 = Textfield(n)
inputBox3 = Textfield(o)
q_1, r_1 = SDLine(P, P_6, P_5, P_4)
s_1, t_1 = SDLine(P, P_4, P_6, P_5)
a_2, b_2 = SDLine(P_5, P_2, P_4, O)
c_2, d_2 = SDLine(P_5, P_2, P, P_3)
e_2, f_2 = SDLine(P_6, P_1, P_3, P)
g_2, h_2 = SDLine(P_6, P_3, P_5, P_1)
i_2, j_2 = SDLine(P, P_5, P_4, P_6)
k_2, l_2 = SDLine(P_5, P_3, P_2, P)
m_2, n_2 = SDLine(P_4, P_1, P, O)
q_2, r_2 = SDLine(P_2, P_4, P, P_1)
s_2, t_2 = SDLine(O, P_2, P_3, P_1)
a_3, b_3 = SDLine(O, P_1, P_4, P_6)
c_3, d_3 = SDLine(P_3, O, P_5, P_6)
text5: "$ cosα=\frac{\overline{OP_1}}{\overline{OP}} =\frac{" + (LaTeX[d_1]) + "}{" + (LaTeX[h_1]) + "}=" + (LaTeX[FractionText[d_1 / h_1]]) + "$"
text6: "$ cosβ=\frac{\overline{OP_2}}{\overline{OP}}=\frac{" + (LaTeX[f_1]) + "}{" + (LaTeX[h_1]) + "}=" + (LaTeX[FractionText[f_1 / h_1]]) + "$"
text7: "$ cosγ=\frac{\overline{OP_3}}{\overline{OP}} =\frac{" + (LaTeX[t]) + "}{" + (LaTeX[h_1]) + "}=" + (LaTeX[FractionText[t / h_1]]) + "$"

Tool: SDLine
Input: A, B, C, D
Output: g, h

b: sgn(sin(Angle[D, B, A]))
a: sgn(sin(Angle[A, B, C]))
c: sgn(a + b + 0.5)
d: sqrt(c)
e: sqrt(-c)
E = Midpoint(A, B)
A' = Dilate(A, d, E)
B' = Dilate(B, d, E)
g = Segment(A', B')
A'_1 = Dilate(A, e, E)
B'_1 = Dilate(B, e, E)
h = Segment(A'_1, B'_1)