# Intercept theorem in sage

Hi,

I'm working on Grobner bases and Buchberger algorithm and begginning in Sage. I would like to find a way to prove that if we have $B, C, D$ three points, then the point $C$ is in the circle of diameter $BD$ if and only if the triangle $BCD$ is an $C$-shaped right-angled triangle.

I'm thinking about using the Intercept theorem but I would like to prove it using Sage.

Thank you

edit retag close merge delete

Sort by ยป oldest newest most voted

There is a first phase of translating the synthetic geometry into analytic / algebraic geometry. Let us suppose that $B,D$ are located in the points with coordinates $(-1,0)$, and respectively $(1,0)$.

Then $C=C(x,y)$ is on the circle with diameter $BD$, iff its distance to the origin $(0,0)$ is one. We get thus the condition: $$x^2+y^2-1 =0\ .$$ The perpendicularity condition $BC\perp CD$ is written equivalently as the fact, that the slopes product is minus one: $$\frac{y-0}{x-(-1)}\cdot \frac{y-0}{x-(-1)} = -1\ .$$ The two conditions are obviously equivalent. It is hard to find something in sage that checks that an element is in an ideal. We may of course force the situation and type:

sage: R.<x,y> = QQ[]
sage: J = R.ideal( x^2 + y^2 - 1 )
sage: mBC = (y-0) / ( x-(-1) )
sage: mCD = (y-0) / ( x-(+1) )
sage: ( mBC*mCD + 1 ).numerator() in J
True

This is very convincing, and may make us think sage did very quickly a hard job, but after...

sage: ( mBC*mCD + 1 ).numerator()
x^2 + y^2 - 1

we can only sell the code as a joke!

more