Student Lab | Class 3: Co-ordinate Geometry

Geometric Proofs, Shape Properties, and Hitbox Algorithms.

The Rules of Proof

In NCEA, you cannot just look at a shape and say "it looks like a square." You must prove it using the Big Three (Distance, Midpoint, Gradient). Here is the blueprint for proving any quadrilateral.

Parallelogram

How to prove it (Choose One):

  • Gradient: Prove opposite sides are parallel ($m_1 = m_2$).
  • Midpoint: Prove the diagonals bisect each other (they share the exact same midpoint).

Rectangle

Prove it's a Parallelogram, PLUS (Choose One):

  • Gradient: Prove one corner is exactly 90° ($m_1 \times m_2 = -1$).
  • Distance: Prove the two diagonals are exactly the same length.

Rhombus

Prove it's a Parallelogram, PLUS (Choose One):

  • Distance: Prove two adjacent sides are equal in length.
  • Gradient: Prove the diagonals cross at exactly 90°.

Square

The Ultimate Proof:

You must prove it has the properties of BOTH a Rectangle (90° corners) and a Rhombus (equal sides).

Interactive Proof

Use the rules to identify this shape. Calculate the gradients and distances to build an undeniable mathematical proof.

Four coordinates are given: A(0, 0), B(4, 3), C(9, 3), and D(5, 0). Prove what specific shape this forms.

Step 1: Calculate the Gradient of AB.

$m_{AB} =$ Incorrect ( left) Ans: 0.75

Step 2: Calculate the Gradient of DC.

$m_{DC} =$ Incorrect ( left) Ans: 0.75
Because $m_{AB} = m_{DC}$ and $m_{AD} = m_{BC} = 0$, the opposite sides are parallel. It is at least a Parallelogram.

Step 3: Calculate Distance of AB.

$d_{AB} =$ Incorrect ( left) Ans: 5

Step 4: Calculate Distance of BC.

$d_{BC} =$ Incorrect ( left) Ans: 5

Step 5: Final Conclusion

It is a parallelogram with adjacent sides equal in length. Therefore it is a...

Incorrect ( left) Ans: Rhombus

Excellence: Forcing a Shape

Instead of asking you to identify a shape, Excellence questions will give you three points and ask you to find the exact coordinates of the fourth point to force the shape into a specific geometry.

The Parameter Puzzle

Three coordinates are A(0, 0), B(2, 4), and D(-1, 1). We want to place C(k, 5) so that ABCD forms a Parallelogram. Find $k$, then determine if it is a Rhombus.

Step 1: The Diagonals Rule

In a parallelogram, diagonals bisect. So the midpoint of BD must be exactly the same as the midpoint of AC. Calculate the Midpoint of BD.

$M_{BD} =$ ( , ) Incorrect ( left) Ans: (0.5, 2.5)

Step 2: Solve for $k$

The x-coordinate of $M_{AC}$ is $\frac{0 + k}{2}$. Set this equal to the x-coordinate of $M_{BD}$ from Step 1.

$k =$ Incorrect ( left) Ans: 1

Step 3: Distance of AB squared

$d^2_{AB} =$ Incorrect ( left) Ans: 20

Step 4: Distance of BC squared

Use $k$ from Step 2 to calculate distance from B to C.

$d^2_{BC} =$ Incorrect ( left) Ans: 2

Step 5: Is it a Rhombus?

Incorrect ( left) Ans: No

CS Application: Hitbox Algorithms

The Orthogonal Bounding Box (Hitbox)

1. What is a Hitbox?

In video games, characters have invisible boxes wrapped around them. When a bullet's coordinate enters this box, the game registers a collision (a "hit"). Checking boundaries is mathematically instant if the box is a perfect rectangle.

2. The Rotation Problem

When a character rotates (e.g., a car drifting), the engine uses complex trigonometric matrices to rotate the four corners of the hitbox. However, computer memory has floating-point limits, causing tiny rounding errors.

3. The Geometric Glitch

Because of these rounding errors, the 4 rotated corners might accidentally warp into a weird kite or trapezoid. If this happens, physics glitches occur (like walking through a wall or being shot through cover).

4. The Verification

To prevent this, the engine runs a fast algebraic check every single frame: "Do these 4 rotated coordinates still form a perfect 90° Rectangle?" It calculates gradients and midpoints to verify the shape.

5. The End of the Story (What Happens Next?)

If the test PASSES (It is a Rectangle): The physics engine trusts the coordinates. It proceeds to calculate the super-fast collision math to see if the player gets hit.

If the test FAILS (It is NOT a Rectangle): The engine catches the floating-point glitch! Before allowing the frame to render, it actively forces the coordinates to snap back into a perfect 90° matrix. This prevents players from experiencing broken physics or unfair gameplay.

Engine Verification Test

A game object is rotating. The engine spits out 4 corners: P1(1, 2), P2(3, 6), P3(7, 4), and P4(5, 0). Prove algebraically that this shape is a perfect Rectangle.

Step 1: Check for a 90° Corner (Gradient P1 to P2)

$m_{P1P2} =$ Incorrect ( left) Ans: 2

Step 2: Gradient of Adjacent Side (P2 to P3)

$m_{P2P3} =$ Incorrect ( left) Ans: -0.5

Step 3: Verify the Corner

$m_1 \times m_2 =$ Incorrect ( left) Ans: -1

Step 4: Verify it's closed (Diagonals Bisect)

Calculate the Midpoint of diagonal P1-P3. The engine verified P2-P4 has the exact same midpoint!

$M =$ ( , ) Incorrect ( left) Ans: (4, 3)
PROOF COMPLETE: Diagonals bisect (Parallelogram) + 90° Corner (Rectangle). Hitbox verified!