Note that there are some explanatory texts on larger screens.

plurals
  1. POpython geometry help
    primarykey
    data
    text
    <p>I have the following problem, I am trying to find the following distances (F1 and F2): <a href="http://i50.tinypic.com/15xac5d.png" rel="nofollow noreferrer">circle http://i50.tinypic.com/15xac5d.png</a></p> <p>This is what I have as of now:</p> <pre><code>def FindArrow(self, X1, Y1, X2, Y2, X3, Y3): self.X1 = float(X1) self.Y1 = float(Y1) self.X2 = float(X2) self.Y2 = float(Y2) self.X3 = float(X3) self.Y3 = float(Y3) #center coords of the circle self.Xc = None self.Yc = None #radius self.R = None #F1 and F2 self.FAB = None self.FBC = None #check if the coordinates are collinear invalide = self.X1 * (self.Y2 - self.Y3) + self.X2 * (self.Y3 - self.Y1) + self.X3 * (self.Y1 - self.Y2) if (invalide == 0): return #get the coords of the circle's center s = (0.5 * ((self.X2 - self.X3)*(self.X1 - self.X3) - (self.Y2 - self.Y3) * (self.Y3 - self.Y1))) / invalide self.Xc = 0.5 * (self.X1 + self.X2) + s * (self.Y2 - self.Y1) self.Yc = 0.5 * (self.Y1 + self.Y2) + s * (self.X1 - self.X2) #get the radius self.R = math.sqrt(math.pow(self.Xc - self.X1, 2) + math.pow(self.Yc - self.Y1, 2)) </code></pre> <p>Until here everything seems to work, now what would be the next steps to get F1 and F2 ?</p> <p><strong>EDIT:</strong> Both of the answers (Tomer and inerjay) seem to work for the first image, but I have tried the following image and it does not work anymore :</p> <p><a href="http://i45.tinypic.com/20b232b.png" rel="nofollow noreferrer">circle2 http://i45.tinypic.com/20b232b.png</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload