Let's just define, arbitrarily, u
= k x N / || k x N ||

By construction, u is perpendicular to both k and N

then Let's define v = N x u / || N x u ||

With u and v, we've got an orthogonal basis (hamel basis) within
the plan normal to N

What if N and j are orthogonal ?

then N and j are not parallel => N x
j not null => u = N x j

What about continuity issues (would it
be better to use i : N x i ?)

An application : the envelope of a path

Slide 14 : 14 / 23 : Locus

Where could I Be ?

If I look at two landmarks (identifiable features with known coordinate) and
if I am able to measure the apparent angle between these two points, could I
derive my position from that observation ?

No, because there exist a full set of point (called a Locus of point) that
will accommodate these parameter.

Locus of point defined by a constant view angle from 2 fixed points.

Set of point defined by the fact that they form a given angle with two fixed
points (A et B, of the Euclidian Plane).

NB : Be careful to be coherent with the orientation of your
angles, and that the construction is not the same if the angle is acute (<90°)
or obtuse (>90°)

Slide 15 : 15 / 23 : Locus

Locus of point defined by a constant view angle from 2 fixed points

Set of point defined by the fact that they form a given angle with two fixed
points (A et B, of the Euclidian Plane).

0) Given A, B and an angle c defined between
0 and 180°, positive from A to B. We will demonstrate that the set of point
C such as aCb = c is indeed the arc AB (which arc AB is defined by the relative
value of the angle compared to 90°). To achieve that, we consider one given
C point that verify aCb = c and we look at the centre of the circum(scribed
)circle for the triangle (ABC). We will indeed show that this circle can be
describe without referring to C, but just AB and the angle c, and that therefore
the possible set of C points are all on that circle.

1) Given ABC, it is well known that the circumscribed
circle has its circumcenter O at the intersection of the 3 perpendicular bisectors
of the triangle. Let's consider the two triangles (OCB) and (OAC) which share
the common edge [OC]. c = c1 + c2

2) In all triangles, the somme of the angles
equal to180. As O is on the perpendicular bisector of [CB], then (OCB) is a
isosceles and therefore oCb = cBo = c1. From those two fact the last angle bOc
= 180 - 2.c1

3) Likewise, in the isosceles triangle (OAC),
we get cOa = 180 - 2.c2

4) bOa = bOc + cOa = 180 - 2.c1 + 180 - 2.c2
= 360 - 2 c

5) I is the middle of [AB], and then on its
same perpendicular bisector as O. Therefore (IOB) is rectangle in I. Knowing
I, A and the angle iOa = bOa / 2 = 180 - c, it is possible to defined O, without
any reference to C. We have indeed demonstrate that given two fixed point A
and B and an oriented angle c, the set of point C such as aCb = c is on the
circle defined by its centre O and its radius OA.

NB. : Just note the effect of the orientation
of the angle and its value relative to 90° to the selection of the part
of the circle and the position of O relative to [AB]

Circumcircle
: http://mathworld.wolfram.com/Circumcircle.html
"The circumcircle is a triangle's circumscribed circle, i.e., the unique
circle that passes through each of the triangles three vertices. The centre
O of the circumcircle is called the circumcenter , and the circle's radius
R is called the circumradius . A triangle's three perpendicular bisectors
,, and meet (Casey 1888, p. 9) at O(Durell 1928)."

PS. Question : why is the intersection of
the 3 orthogonal bisectors the centre of the circumcircle ... ?

Slide 16 : 16 / 23 : Triangulation

Almost Triangulation : why you need at least two measures to guess where you
are ...

4 landmarks solution

3 landmarks solution

Why we should use the 3 landmarks solution

Why we should use the 4 landmarks solution

Always use landmarks as away as possible from you

Triangulation : A method of fixing an unknown point (for example in navigation)
by making it a vertex of a triangle whose other vertices and angles are known
(Collins Dictionary of Mathematics).

Slide 17 : 17 / 23 : Triangulation with a compass

Triangulation with a compass

Then you need only 2 landmarks !

You indeed still use 3 landmarks, the last
one only happen to be really, really far away (North direction) and this is
just a special limit case of the previous situation (when the arc of the circle
tend to a segment when N tend towards the North direction)

Slide 18 : 18 / 23 : Intersection between two circles

Intersection between two circles

Given O1(x1,y1,z1), O2(x2,y2,z2), the center of the circles and r1 and r2,
their Radius

Then you replace x within (1) and you solve an equation
of the second degree ...

...piece of cake but ...

Slide 19 : 19 / 23 : Intersection between two circles (2)

Intersection between two circles (2)

Given O1(x1,y1,z1), O2(x2,y2,z2), the center of the circles and r1 and r2,
their Radius

Given M(x,y,z) the intersection, then another way is ...

O1O2 > r1 + r2

O1O2 < (r1 - r2) and (r1>r2)
NB.: what if r1 = r2 ?

O1O2 = r1 + r2

r1 - r2 < O1O2 < r1 + r2

r1 - r2 < O1O2 < r1 + r2

r1 - r2 < O1O2 < r1 + r2

NB. : when you see " = 0 " in Maths, you translate
into "< Epsilon" in Computer

Slide 20 : 20 / 23 : Intersection between two circles (3)

Intersection between two circles (3)

Given O1(x1,y1,z1), O2(x2,y2,z2), the center of the circles and r1 and r2,
their Radius

Given M(x,y,z) the intersection, then another way is ...

O1H = x

MH = h

0102 = d

H02 = d - x

(1) R12
= h2 + x2

(2) R22
= h2 + (d - x )2
= h2 + d2 -2dx +
x2

(2) - (1) R22
- R12 = d2
- 2dx

=> x = (d2
- R22 + R12)/2d

(1) h = +/- squareroot(R12
- x2)

M = O1 + O1
H +/- HM

Then O1H = x. O1O2/||O1O2||
then inverse -x and y of O1O2/||O1O2|| vector to get an orthogonal vector

Slide 21 : 21 / 23 : Intersection between two circles (4)

Intersection between two circles (4)

AMB : Obtuse

AM'B, A'M'B', A'MB' : Acute

AMB obtuse <=> MA . MB < 0

What if AMB is a right angle ?

Then we have to be sur of the sign of the
angle

Slide 22 : 22 / 23 : Exercise from Last year Exam

Exercise from Last year Exam

Question 16 ( 8 marks ) :

Write an algorithm (Java-like pseudocode) that will calculate the point of
intersection of a ray (semi segment) and a triangle. The method should return
the status of the intersection (intersect or not, and, if not, why not ). If
it intersects, then the method should also return the coordinates of the intersection.
Use comments in your code to explain the algorithm.

The ray is defined by the origin point O and the direction vector V.
The triangle is defined by the 3 vertices P0, P1, P2.

Tip : if vertices A, B, C and D are on the same plane and if D = A + sAB +
tAC then D is inside triangle ABC if and only if s>=0, t>=0 and s+t <=
1

First compute the intersection point M between the ray and the plane of
the triangle

Then compute s and t such as M = P0 + sP0P1 + tP0P2

Considering that M is inside the triangle if and only if s
>= 0, t >= 0 and s+t <= 1 draw your conclusion

Slide 23 : 23 / 23 : Exercise from Last year Exam

Exercise from Last year Exam

Question 16 ( 8 marks ) :

Write an algorithm (Java-like pseudocode) that will calculate the point of
intersection of a ray (semi segment) and a triangle. The method should return
the status of the intersection (intersect or not, and, if not, why not ). If
it intersects, then the method should also return the coordinates of the intersection.
Use comments in your code to explain the algorithm.

The ray is defined by the origin point O and the direction vector V.
The triangle is defined by the 3 vertices P0, P1, P2.

Tip : if vertices A, B, C and D are on the same plane and if D = A + sAB +
tAC then D is inside triangle ABC if and only if s>=0, t>=0 and s+t <=
1

First compute the intersection point M between the ray and the plane of
the triangle

Then compute s and t such as M = P0 + sP0P1 + tP0P2

Considering that M is inside the triangle if and only if s
>= 0, t >= 0 and s+t <= 1 draw your conclusion