Boat Grid Animated
Author: Mike May, S.J.
Date: January 2009

Press the PLAY button to animate!

To animate manually, right-click on slider and deselect "Animation on". Then, click and drag the point on the slider.

Show Grid

Radar Screen

tGiro = 1
k = -800
C0 = (136.8388679245283, -251.77252684604724)
c = OrthogonalLine(C0, xAxis)
Zcenit = Point(c)
Zangmin = Rotate(Zcenit, 75.00000000000001°, C0)
f = CircleArc(C0, Zcenit, Zangmin)
Z = Point(f)
e = Circle(C0, Zcenit)
d = OrthogonalLine(C0, c)
Zang0 = Intersect(e, d, 2.0)
α = Angle(Z, C0, Zang0)
t = 3.4 (slider from 0 to 10, step 0.01)
B_2 = (126.45459119496873, 165.2729031162171)
B_1 = Point(yAxis)
B'_1: (y(B_1) cos(α), y(B_1) sin(α) + k)
a = Ray(B_1, B_2)
v = Vector(B_1, B_2)
B0: B_1 + t v
Ship_B = 70 (slider from 10 to 150, step 1)
B14: B_1 - UnitVector[v] Ship_B / 2.0
B13: B_1 + UnitVector[v] Ship_B / 2.0
A_2 = (848.8226415094339, 73.22802791747479)
A_1 = Point(xAxis)
b = Ray(A_1, A_2)
C = Intersect(a, b)
v4 = Vector(B14, C)
tB4: x(v4 / v)
v3 = Vector(B13, C)
tB3: x(v3 / v)
v1 = Vector(B_1, C)
tB: x(v1 / v)
u = Vector(A_1, A_2)
Ship_A = 150 (slider from 10 to 150, step 1)
A14: A_1 - UnitVector[u] Ship_A / 2.0
u4 = Vector(A14, C)
tA4: x(u4 / u)
A13: A_1 + UnitVector[u] Ship_A / 2.0
u3 = Vector(A13, C)
tA3: x(u3 / u)
tImpacto = If(tB3 ≤ tA3 ∧ tA3 ≤ tB4, tA3, If[tA3 ≤ tB3 ∧ tB3 ≤ tA4, tB3, 1000.0])
B = If(t < tImpacto, B0, B_1 + tImpacto v)
B': (x(B) + y(B) cos(α), y(B) sin(α) + k)
uB = Vector(B'_1, B')
wB = Vector(B', B' - (0.0, 200.0))
βB3 = Angle(wB, uB)
B4: B - UnitVector[v] Ship_B / 2.0
B4': (x(B4) + y(B4) cos(α), y(B4) sin(α) + k)
B4Proa = Rotate(B4', -1.0 * 1.0 βB3 If[t - tImpacto < tGiro, t - tImpacto, 1.0], B')
B4Popa = Rotate(B4', (180.0 ° - βB3) If[t - tImpacto < tGiro, t - tImpacto, 1.0], B')
B4'' = If(tB < tImpacto, B4Popa, B4Proa)
B4''': B4'' + (t - tImpacto - tGiro) wB
BB4Proa = If(t < tImpacto, B4', If[t - tImpacto < tGiro, B4'', If[y(B4') - y(B4''') < 200.0 - Ship_B / 2.0, B4''', B' - (0.0, 200.0 - Ship_B / 2.0)]])
B3: B + UnitVector[v] Ship_B / 2.0
B3': (x(B3) + y(B3) cos(α), y(B3) sin(α) + k)
B3Proa = Rotate(B3', -1.0 * 1.0 βB3 If[t - tImpacto < tGiro, t - tImpacto, 1.0], B')
B3Popa = Rotate(B3', (180.0 ° - βB3) If[t - tImpacto < tGiro, t - tImpacto, 1.0], B')
B3'' = If(tB < tImpacto, B3Popa, B3Proa)
B3''': B3'' + (t - tImpacto - tGiro) wB
BB4Popa = If(t < tImpacto, B4', If[t - tImpacto < tGiro, B4'', If[y(B') - y(B4''') < 200.0, B4''', B' - (0.0, 200.0)]])
BB3Proa = If(t < tImpacto, B3', If[t - tImpacto < tGiro, B3'', If[y(B3') - y(B3''') < 200.0, B3''', B' - (0.0, 200.0)]])
BB3Popa = If(t < tImpacto, B3', If[t - tImpacto < tGiro, B3'', If[y(B') - y(B3''') < 200.0 - Ship_B / 2.0, B3''', B' - (0.0, 200.0 - Ship_B / 2.0)]])
B5': B4' + (0.0, 40.0)
B5Popa = Rotate(B5', (180.0 ° - βB3) If[t - tImpacto < tGiro, t - tImpacto, 1.0], B')
B5Proa = Rotate(B5', -1.0 * 1.0 βB3 If[t - tImpacto < tGiro, t - tImpacto, 1.0], B')
B5'' = If(tB < tImpacto, B5Popa, B5Proa)
B5''': B5'' + (t - tImpacto - tGiro) wB
BB5Popa = If(t < tImpacto, B5', If[t - tImpacto < tGiro, B5'', If[y(B5') - y(B5''') < 200.0, B5''', B' - (40.0, 200.0)]])
BB5Proa = If(t < tImpacto, B5', If[t - tImpacto < tGiro, B5'', If[y(B5') - y(B5''') < 200.0 - Ship_B / 2.0, B5''', B' - (-1.0 * 1.0 * 40.0, 200.0 - Ship_B / 2.0)]])
A0: A_1 + t u
A = If(t < tImpacto, A0, A_1 + tImpacto u)
A4: A - UnitVector[u] Ship_A / 2.0
A3: A + UnitVector[u] Ship_A / 2.0
g = CircleSector(C0, Zcenit, Zang0)
LowerGridHorizontal = Sequence(Segment[(s cos(α), s sin(α) + k), (s cos(α) + 1200.0, s sin(α) + k)], s, 0.0, 1200.0, 100.0)
LowerGridVertical = Sequence(Segment[(s, k), (s + 1200.0 cos(α), 1200.0 sin(α) + k)], s, 0.0, 1200.0, 100.0)
UpperGridHorizontal = Sequence(Segment[(0.0, s), (1200.0, s)], s, 100.0, 1200.0, 100.0)
UpperGridVeritical = Sequence(Segment[(s, 0.0), (s, 1200.0)], s, 100.0, 1200.0, 100.0)
A': (x(A) + y(A) cos(α), y(A) sin(α) + k)
A'_1: (x(A_1), k)
h = Ray(B'_1, B')
i = Ray(A'_1, A')
C': (x(C) + y(C) cos(α), y(C) sin(α) + k)
j = Segment(B'_1, C')
l = Segment(A'_1, C')
B04: B0 - UnitVector[v] Ship_B / 2.0
B03: B0 + UnitVector[v] Ship_B / 2.0
A04: A0 - UnitVector[u] Ship_A / 2.0
A03: A0 + UnitVector[u] Ship_A / 2.0
m = Segment(B3, B4)
n = Segment(A3, A4)
D = Intersect(m, n)
A3': (x(A3) + y(A3) cos(α), y(A3) sin(α) + k)
A4': (x(A4) + y(A4) cos(α), y(A4) sin(α) + k)
A5': A4' + (0.0, 40.0)
wA = Vector(A', A' - (0.0, 200.0))
u1 = Vector(A_1, C)
tA: x(u1 / u)
uA = Vector(A'_1, A')
βA3 = Angle(wA, uA)
A3'': A3' + (t - tImpacto) wB
A4'': A4' + (t - tImpacto) wB
AA3 = If(t < tImpacto, A3', If[y(A3') - y(A3'') < 200.0, A3'', A3' - (0.0, 200.0)])
AA4 = If(t < tImpacto, A4', If[y(A4') - y(A4'') < 200.0, A4'', A4' - (0.0, 200.0)])
A5'': A5' + (t - tImpacto) wB
AA5 = If(t < tImpacto, A5', If[y(A5') - y(A5'') < 200.0, A5'', A5' - (0.0, 200.0)])
BB5 = If(tB < tImpacto, BB5Popa, BB5Proa)
BB3 = If(tB < tImpacto, BB3Popa, BB3Proa)
BB4 = If(tB < tImpacto, BB4Popa, BB4Proa)
E: (0.0, k)
F: (1200.0 cos(α), 1200.0 sin(α) + k)
G: (1200.0, k)
H: G + F - E
p1, p11, p12, p13, p14 = Polygon(E, F, H, G)
p2, p21, p22, p23, p24 = Polygon(E, G, G - (0.0, 200.0), E - (0.0, 200.0))
p3, p33, p34, p31, p32 = Polygon(G, H, H - (0.0, 200.0), G - (0.0, 200.0))
ShowGrid = false