1 of 21

How to locate a point?

Laure Barthel, Hadassah Academic College

iTEM: Innovative Teaching Education in Mathematics

https://item.chania.teicrete.gr/

2 of 21

Problem

  • Suppose you are programming a game.
  • At some point, you need to know if a user’s click is inside a given triangle or not.

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

3 of 21

Human versus computer

  • Triangle( (3,1),(1,2),(2,-3))
  • Point (2.58,-1.4)

Easy!

????????

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

4 of 21

Let’s think…

  • Why is the point P outside the triangle?
  • Because it is on the wrong side of the line AC.

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

5 of 21

Nice idea, but…

  • Ok, the computer computed the equations of the lines.
  • But what is the “right” side?
  • Triangle( (3,1),(1,2),(2,-3))
  • Point (2.58,-1.4)
  • Line AB: x+2y=5
  • Line BC: 5x+y=7
  • Line AC:4x-y=11

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

6 of 21

Two representations of a line in the plane

  • Equation
  • The normal vector points to one side.�
  • Parametric representation
  • Both sides are the same.

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

7 of 21

  • Opposite side from the normal vector
  • Same side as the normal vector

Acute angle

Obtuse angle

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

8 of 21

But how do I measure angles?

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

9 of 21

Tool for measuring angles

  • We introduce a new operation on vectors: the scalar product, or dot product. It is very easy to compute (only addition and multiplication):

  • The dot product is linked to the angle α between the two vectors:�

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

10 of 21

How to use it in our case?

  • We do not need the angle.
  • We need the sign of the cos.
  • Sign of the dot product is enough.

Cos α<0

Cos α>0

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

11 of 21

Exercise

  • Show that

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

12 of 21

It is getting better:

For each line, I can check if P is on the side of the normal vector or on the opposite side.

But, how do I know which side is the correct one or the wrong one for the triangle and the choice of the normal vectors?

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

13 of 21

Answer

  • For each point, use the other point in the triangle.
  • It will show what is the right side and what is the wrong side.

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

14 of 21

Exercise

  • Write a pseudo code for the following problem:
  • Input: three points A,B,C and a point P
  • Output: Is the point P in the triangle or outside the triangle?

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

15 of 21

Same question for these cases

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

16 of 21

Result.� What is the difference between the two cases?

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

17 of 21

Which sides of the polygon are lighted?

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

18 of 21

Related problem: incremental construction of a convex hull

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

19 of 21

Circular sorting of points

  • Sort the point by the angle with the positive x-axis.
  • Some angles are larger than π. How does one deal with this?

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

20 of 21

Conclusion

  • Show the students the different functions of the two representations of a line: parametric representation and equation.
  • Emphasizes the importance of an algebraic approach to the geometric problems (the computer does not see).
  • Promote an algorithmic approach to geometric problems

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/

21 of 21

Thank you for your attention!

iTEM: Innovative Teaching Education in Mathematics: https://item.chania.teicrete.gr/