100Mathematics · Coordinate geometry

Four Triangle Centres: Cartesian Components

fx-50FH II · CMPLX · 200 bytes

Enter three vertices as complex numbers. From the x and y components of two edges and Cramer's rule, the program gives the centroid G, circumcentre O, orthocentre H and incentre I, in that order.

  • 200 bytes
  • CMPLX mode
01

Worked examples

Example 1

A uniform triangular plate has vertices A(1,1), B(7,1) and C(4,5). Find the centroid G, the circumcentre O, the orthocentre H and the incentre I, and determine whether the four centres lie on one straight line.

Answer
G=(4,7/3), O=(4,15/8), H=(4,13/4), I=(4,5/2). The four centres lie on the line x=4.
Standard solution (without a calculator)
  1. Find the axis of symmetry: AB=6 and AC=BC=√(3²+4²)=5. Since 6²<5²+5², the triangle is acute and isosceles, with axis of symmetry x=4.
  2. Centroid: G=((1+7+4)/3,(1+1+5)/3)=(4,7/3).
  3. Circumcentre: the perpendicular bisector of AB is x=4. Let O=(4,t). From OA=OC, 9+(t−1)²=(t−5)², so 8t=15 and O=(4,15/8).
  4. Orthocentre: the altitude from C is x=4. BC has slope −4/3, so the altitude from A is y−1=(3/4)(x−1). At x=4, y=13/4, so H=(4,13/4).
  5. Incentre: let I=(4,t). The line AC is 4x−3y−1=0. Equal distances to AB and AC give t−1=(15−3t)/5, so 8t=20 and I=(4,5/2).
  6. Collinearity: all four centres have x-coordinate 4, so they lie on x=4. This comes from the isosceles symmetry; the four centres of a general triangle need not be collinear.
Do it on the calculator

Example 2

A triangular garden has vertices A(0,0), B(6,0) and C(0,8), with coordinates in metres. Find the centroid G, the circumcentre O, the orthocentre H and the incentre I, and state which centre coincides with a vertex.

Answer
In metres, G=(2,8/3), O=(3,4), H=(0,0) and I=(2,2). The orthocentre H coincides with the right-angle vertex A.
Standard solution (without a calculator)
  1. Centroid: G=((0+6+0)/3,(0+0+8)/3)=(2,8/3).
  2. Circumcentre: the midpoint of AB is (3,0), so its perpendicular bisector is x=3; the midpoint of AC is (0,4), so its perpendicular bisector is y=4. Hence O=(3,4), the midpoint of the hypotenuse BC.
  3. Orthocentre: AB is horizontal, so the altitude from C is x=0; AC is vertical, so the altitude from B is y=0. They meet at H=(0,0)=A.
  4. Incentre: I is in the first quadrant and equidistant from x=0 and y=0, so let I=(r,r). The line BC is 4x+3y=24, and its distance from I is (24−7r)/5. Setting this equal to r gives 24−7r=5r, so r=2 and I=(2,2).
Do it on the calculator

Example 3

On a survey plan, a triangle has vertices A(−4,−1), B(4,−1) and C(−2,1). Find the centroid G, the circumcentre O, the orthocentre H and the incentre I, and determine whether O and H lie inside the triangle.

Answer
G=(−2/3,−1/3), O=(0,−3), H=(−2,5). With s=4+√2+√10, I=(−4+8(1+√2)/s,−1+8/s)≈(−1.748064098,−0.06721760771). O and H lie outside the triangle.
Standard solution (without a calculator)
  1. Identify the shape: AB²=64, AC²=8 and BC²=40. Since 64>8+40, the angle at C is obtuse, so O and H may lie outside the triangle.
  2. Centroid: G=((−4+4−2)/3,(−1−1+1)/3)=(−2/3,−1/3).
  3. Circumcentre: the perpendicular bisector of AB is x=0. The midpoint of AC is (−3,0) and AC has slope 1, so its perpendicular bisector is y=−x−3. Hence O=(0,−3), below the base AB.
  4. Orthocentre: the altitude from C is x=−2. BC has slope −1/3, so the altitude from A is y+1=3(x+4), that is y=3x+11. At x=−2, y=5, so H=(−2,5), above C.
  5. Incentre: let the inradius be r>0, so I=(x,r−1). The distance from I to AC: x−y+3=0 equals r, so x=−4+(1+√2)r. The distance to BC: x+3y−1=0 gives [1−x−3(r−1)]/√10=r, so r=8/(4+√2+√10).
  6. Substitute and locate: with s=4+√2+√10, I=(−4+8(1+√2)/s,−1+8/s)≈(−1.748064098,−0.06721760771). Negative coordinates do not affect the definition of the incentre. The triangle lies in −1≤y≤1, so O (y=−3) and H (y=5) are outside it, while G and I are inside.
Do it on the calculator
02

When to use it

Use this forward calculation when all three numerical vertices of a triangle are known. Each complex number x+yi stands for the point (x,y). This Cartesian version splits two edge vectors into x and y components and solves two simultaneous equations, so its steps follow a written coordinate-geometry solution.

Enter the three vertices

  • At A?, B? and C?, enter the first, second and third vertices. Write (x,y) as x+yi, using ENG for i and (−) for a negative number. For example, (−4,−1) becomes −4−i; (0,8) becomes 8i; (6,0) becomes 6.
  • Enter all three vertices again for every run, including zeros. A blank EXE keeps the current variable value, and the program overwrites several variables, so a retained value may no longer be a vertex.

Read G, O, H and I

  • The order is centroid G → circumcentre O → orthocentre H → incentre I. Each result is a coordinate pair. With R⇔I shown and no i, read x; press SHIFTEXE to read y, which is shown with i.
  • When x=0 and y≠0, the first page shows y with i; SHIFTEXE then shows x=0. When y=0 there is no R⇔I, and the single real value gives (x,0). Check the indicators before naming a coordinate.
  • At the G, O and H pauses, ordinary EXE moves to the next centre; switching component pages does not change Ans or the variables. After I, press AC to leave; ordinary EXE runs the program again.

Choosing among the four versions

  • Programs 100–103 take the same input and show G, O, H and I in the same order: 100 Cartesian components (200 bytes), 101 similarity transform (105 bytes, the shortest), 102 side-length weights (177 bytes) and 103 angles and rotation (140 bytes, sets Deg itself). For ordinary data their answers agree; choose by the method you want to study and the program memory available.
  • For nearly collinear or very thin triangles, prefer 100 or 101 and avoid 102. Version 103 evaluates the most trigonometric functions of the four.

Suitable questions

  • Original HKDSE compulsory mathematics coordinate-geometry practice: find numerical triangle centres, compare their positions (inside or outside the triangle, at a vertex, on an axis of symmetry), or use a centre to write a circle equation. If only side equations are given, solve for the vertices first. The program does not give radii, area, perimeter or a written proof.

Before using the program

  • Create the program in CMPLX, select a+bi and Norm 1, and reserve 200 bytes in an empty slot; P1–P4 share 680 bytes. Deg, Rad and Gra do not change this algorithm; the illustrated runs use Deg.
  • The three vertices must be distinct and not collinear, with both axes in the same length unit. For repeated or collinear points the program may first display the mean of the points and then show Math ERROR; that first value does not mean the centres were found.
  • Ordinary examination coordinates are suitable. Very large common offsets, extremely small or large scales, or almost collinear triangles can lose accuracy or cause an error; finite precision cannot be guaranteed for every range. Round only as the question requires.
  • A, B, C, D, X, Y, M and Ans are overwritten; no memory needs clearing first, and Ans is not read. This is a forward numerical tool; it cannot solve for an unknown vertex or a symbolic parameter.

Sign in to unlock the full programme

Checking access…

The programme code and appendix unlock together.

Checking access…

Sign in to unlock the full programme

Checking access…

The programme code and appendix unlock together.