# Numerically determine area and circumference

1. Nov 6, 2004

### anders_svensson

Hey guys

I'm currently making a small game (simple space game) and have a problem with numerically determine area and circumference of a ball that is being thrown.

The problem is presented here:

http://trasigkondensator.tripod.com/ball.htm

2. Nov 6, 2004

### devious_

That looks like a cardioid. It's general equation in polar coords is: r=a(1-cost), but it could also be r=a(1+cost), i.e. flipped around. I think the maximum distance from the point where it has an 'indent' is 2a, but I'm not entirely sure. a could possibly be either the length of the rope or the radius of the circle.

The path of motion of the ball looks like a distored ellipse/circle. Perhaps someone who's into cosmology can help you out.

Sorry I couldn't be of much help.

3. Nov 6, 2004

### Sirus

I think you meant topology, not cosmology. :)

4. Nov 7, 2004

### devious_

Topology? I don't know much about topology, but I thought some of the astrophysicists/cosmologists could help because the path of the ball looks like several elliptic and circular orbits. :shy:

5. Nov 7, 2004

Oh, I see.

6. Nov 7, 2004

### µ³

Assuming devious is right. Then it would just be a matter of integrating in polar coordinates. Just get a function r in terms of $\theta$ that describes the distance of the ball from the center of the circle and integrate:
$$A=\int_0^{2\pi}\int_0^{r(\theta)}r'dr'd\theta$$
$$A = \frac{1}{2}\int_0^{2\pi}r^2(\theta)d\theta$$
edit - looked up a cardioid, a = the radius of the circle. So:
$$A = \frac{1}{2}\int_0^{2\pi}a^2(1-cos(\theta))^2d\theta$$
$$= \frac{1}{2}a^2\int_0^{2\pi}sin(\theta)^2d\theta$$
$$= \frac{1}{4}a^2\int_0^{2\pi}(1-cos(2\theta))d\theta$$
$$= 3a^2\pi$$

Last edited: Nov 7, 2004