toddl@rt8.cs.wisc.edu (Todd Lehman) (03/07/90)
Hello, I'm stuck on a problem involving cardioids. Maybe someone can help me
out...
Does anyone know of a easy way to test whether a point (x,y) in the
Euclidean plane is in the interior of a cardioid? The cardioid I'm considering
is
r = sin^2 (t/2),
where t is an angle in radians and r is the radius associated with that angle.
Points (x,y) and (r;t) are related by
x = r cos(t)
y = r sin(t)
as (x,y) are Euclidean coordinates and (r;t) are polar coordinates.
One way of performing the test is to get the argument t from the arctangent
of y/x, divide this by two, take the sine of that and square it twice, then see
whether the resulting number is less than or equal to x^2+y^2. But this
involves four multiplies, two divides, a sine, and an arctangent. :-(
In a related problem, to check whether a point (x,y) is inside a circle
r = c,
for some constant c, one need only test whether x^2+y^2 < c^2. This process
involves only two multiplies (c^2 is a constant). :-)
The test for the circle is quite simple. Surely there must be a similarly
simple test for the cardioid...? Any would be much appreciated.
__________
Todd S. Lehman, UW-Madison
toddl%garfield@cs.wisc.edu