|
-
Jul 22nd, 2001, 11:32 AM
#1
transcendental analytic
Tricky
I'd pick a stretched transformation which nullifies the excentricity of the ellipse (making it a circle) and then test the distance's closeness to the border, however very excentric ellipses will have very excentric validation areas as well.
using circle method on vb graphical objects you pass the excentricity but with ellipse api you pass the rect in which the ellipse is inscribed in. divide width by height to get excentricity.
Transform clicked coordinates to non excentric coordinates (divide wither vertical or horizontal coord with e) after moving origo to ellipse center. then get the modulus squared with x*x+y*y. test if it is larger than inner radius squared and smaller than outher radius squared. That should do it.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|