tags:

views:

40

answers:

1

Hi,

I need to determine the X-radius & Y-radius of an ellipse give the major & minor radius and I couldn't find any way how to do it.

I have following inputs:

  1. Center Point
  2. Start Point
  3. Major Radius
  4. Minor Radius

So, My question is how to create the ellipse rect that should be passed to GDI api i.e. DrawEllipse to draw the ellipse.

Thanks & Regards, Pankaj

A: 

Google Bresenham + ellipse (and circle since the algorithm is about the same) or see article http://homepage.smc.edu/kennedy_john/belipse.pdf

Also if you want to have your ellipse in some angle, you might need to draw the ellipse in origo and rotate+translate the point set (e.g. by multiplying the points with suitable matrix)...

svarjo