another yucky geometry question

Jim Hurley jhurley at
Tue Sep 27 11:04:06 EDT 2005


P.S. Over night thoughts:

If one wanted to extend the drawing of an ellipse bounded  by radial 
lines with origin at the vanishing point, the  function "drawEllipse" 
would be helpful.

The difficult part would be determining the values of a,b,tAng, xLoc 
and yLoc such that the ellipse is property sized, angled and 
positioned so that it lies tangent to the given radials.


on drawEllipse a,b,tAng,xLoc,yLoc

   repeat with aa = 1 to 360 step 4 --4 is a compromise: min jaggies 
in min time.
     put r(aa,tAng,a,b,) into r
     put round(xLoc+ r*cos(pi/180*aa)),round(yLoc+r*sin(pi/180*aa)) & 
cr after tPoints
   end repeat
   set the points of grc "ellipse" to tPoints

end drawEllipse

function r angl,phi,a,b

   put cos(pi/180*(angl+phi)) into c
   put sin(pi/180*(angl+phi)) into s
   return sqrt(1/(c*c/a/a + s*s/b/b))-- Ellipse at angle phi

end r

drawEllispe 100,40,30,300,400 will draw an ellipse with a = 100, b = 
40, at an angle of 30 degree and with a loc of 300,400

More information about the Use-livecode mailing list