I am looking for the equations which describe, using trilinear coordinates:
- A line through two given points.
- A circle through three given non-collinear points.
I would also love to get a refernce for a good source on the subject. Thank you!
I am looking for the equations which describe, using trilinear coordinates:
- A line through two given points.
- A circle through three given non-collinear points.
I would also love to get a refernce for a good source on the subject. Thank you!
Trilinear coordinates are a special case of homogeneous coordiates. So if a point $p$ has trilinear coordinates $[x:y:z]$ then you describe a line of such points by a homogeneous equation $ax+by+cz=0$ or equivalently by a coordinate vector $g=[a:b:c]$. Incidence is checked by the dot product, so $p$ lies on $g$ iff $\langle g,p\rangle=ax+by+cz=0$. Given two points $p,q$ the line spanned by them has coordinate vector $p\times q$. See What is the interpretation of homogeneous line intersection? for further discussion.
Circles are harder. Homogeneous coordinates usually go hand in hand with projective geometry, and a generic conic is a much more natural concept there than a circle. You can't find a description of the circle without taking the shape of the basis triangle into account in some way.
In the usual homogenization of the Euclidean plane using $(x,y)\mapsto[x:y:1]$ all circles pass through the ideal circle points $[1:\pm i:0]$. A conic is defined by five points, so three points plus these circle points define a circle. Switching to trilinear coordinates is a change of basis, so the circle points still exist as a concept, but their coordinates are different and more complicated.
A change of basis is equivalent to a projective transformation, which is uniquely defined by four points and their images, as detailed here. So by mapping e.g. the three corners and the incircle center $[1:1:1]$ you could find a matrix for this change of coordinates. You could apply it to the ideal circle points, then describe the circle as a conic through these.
Wolfram and Wikipedia are good references for trilinear coordinates introduction : http://mathworld.wolfram.com/TrilinearCoordinates.html and https://en.wikipedia.org/wiki/Trilinear_coordinates
Long time ago when I began my euclidean geometry comp projects, I had to learn about them because "Triangle geometry" (in the 2D plane) and geometers use a lot this kind of coordinates with their pros and cons. For example, the ETC (Encyclopedia of Triangle Centers - Kimberling) or Wolfram geometry pages or Forum Geometricorum papers. I coded conversions functions (to/from cartesian, polar,..) and use the matrix representation of conics for conics intersection.
Here is one except of my python code to answer your questions :
# TriLine defines a line as the "orthogonal" vector (see TriOnLine)
# Line given in trilinear coordinates : determinant is 0 given two points A1 and A2
# | ta1 tb1 tc1 | point A1 = ta1:tb1:tc1
# | ta2 tb2 tc2 | point A2 = ta2:tb2:tc2
# | ta tb tc | any point M = ta:tb:tc on the line
# (tb1 tc2 - tc1 tb2)ta + (tc1 ta2 - ta1 tc2)tb + (ta1 tb2 - tb1 ta2)tc = 0
def TriLine(a,b,c,t1,t2):
[ta1,tb1,tc1] = t1 ; [ta2,tb2,tc2] = t2
la = tb1*tc2 - tc1*tb2 ; lb = tc1*ta2 - ta1*tc2 ; lc = ta1*tb2 - tb1*ta2
u = a*la + b*lb + c*lc
if u == 0:
l = [la,lb,lc]
else:
l = [la/u,lb/u,lc/u]
return l
# TriOnLine check (if 0 is return) if one point given by trilinear coordinates on a line
# It's same as scalar product on trilinear coordinates
def TriOnLine(t,l):
[la,lb,lc] = l
[ta,tb,tc] = t
on = (la*ta + lb*tb + lc*tc)
return on
For circle I have two answers one using segment bissectors (you can intersect two segment bissectors to get circle center) and one using the equation of a circle in trilinear coordinates. I will give it here the 2nd one (otherwise I should put too, my code for intersecting lines, middle points,..) :
# Circumcircle functions l,m,n such as equation of circle :
# (lx + my + nz)(ax + by + cz) + (ayz + bxz + cxy) = 0
# TriCircumcircleFunctions returns functions for circumcircle of three points
def TriCircumcircleFunctions(a,b,c,t1,t2,t3):
[x1,y1,z1] = t1 ; [x2,y2,z2] = t2 ; [x3,y3,z3] = t3
p = TriCircumcircleFactor(a,b,c,t1,t2,t3)
ml = matrix(SR,3,3)
ml[0,0] = (a*y1*z1 + b*z1*x1 +c*x1*y1)/(a*x1 + b*y1 + c*z1) ; ml[0,1] = y1 ; ml[0,2] = z1
ml[1,0] = (a*y2*z2 + b*z2*x2 +c*x2*y2)/(a*x2 + b*y2 + c*z2) ; ml[1,1] = y2 ; ml[1,2] = z2
ml[2,0] = (a*y3*z3 + b*z3*x3 +c*x3*y3)/(a*x3 + b*y3 + c*z3) ; ml[2,1] = y3 ; ml[2,2] = z3
l = ((-1/p)*ml.determinant())
mm = matrix(SR,3,3)
mm[0,0] = (a*y1*z1 + b*z1*x1 +c*x1*y1)/(a*x1 + b*y1 + c*z1) ; mm[0,1] = x1 ; mm[0,2] = z1
mm[1,0] = (a*y2*z2 + b*z2*x2 +c*x2*y2)/(a*x2 + b*y2 + c*z2) ; mm[1,1] = x2 ; mm[1,2] = z2
mm[2,0] = (a*y3*z3 + b*z3*x3 +c*x3*y3)/(a*x3 + b*y3 + c*z3) ; mm[2,1] = x3 ; mm[2,2] = z3
m = ((1/p)*mm.determinant())
mn = matrix(SR,3,3)
mn[0,0] = (a*y1*z1 + b*z1*x1 +c*x1*y1)/(a*x1 + b*y1 + c*z1) ; mn[0,1] = x1 ; mn[0,2] = y1
mn[1,0] = (a*y2*z2 + b*z2*x2 +c*x2*y2)/(a*x2 + b*y2 + c*z2) ; mn[1,1] = x2 ; mn[1,2] = y2
mn[2,0] = (a*y3*z3 + b*z3*x3 +c*x3*y3)/(a*x3 + b*y3 + c*z3) ; mn[2,1] = x3 ; mn[2,2] = y3
n = ((-1/p)*mn.determinant())
return [l,m,n]
For a short explaination of last function : solving a linear system of three equations (each equation is got by replacing x:y:z by xi:yi:yi in the generic circle equation).