points on ellipse

Hello all,

I have an Ellipse  (height 800, width 200) and try to find

a) the point on the ellipse on a given height 60
b) the tangent at the point found

(please see attached sketch)

gp_Pnt center(0.0, 0.0, 0.0);
gp_Dir dir = gp::DX();
gp_Ax2 axis(center, dir);

gp_Elips ellipse_gp = gp_Elips (axis,800/2,200/2);

Geom_Ellipse gEllipse(ellipse_gp);
gEllipse.D0(60, p);
qDebug() << "gEllipse.D0(" << 60 << ", p)" << p.X() << p.Y() << p.Z();

result:

gEllipse.D0( 60 , p) 0 30.4811 -380.965

Correct result would be

0, 98.869, 60

It is obvious that I have no clue what I am doing - any help is much welcome.

Also, how to find the tangent?

Thanks!

Attachments: 
Luc Wens's picture

Check out GeomLProp_CLProps, GeomAPI_ProjectPointOnCurve and GeomAPI_IntCS(intersect with plane at Z=60) , there should be some answers for you.

Daniel Duesentrieb's picture