#### dudeim

##### New Member

- Reaction score
- 22

I again am having some problems with math.

Currently I'm calculating 3 points at a x radius around a spell casting unit, 3 projectiles should fly to those points, somehow though my calculations are wrong (as I'm no math genius I have no idea why it's not working or even if I'm doing it correct), this is what i do:

JASS:

```
//calculating the starting angle .caster is the caster of the spell and .getY() basicly calls GetUnitY same for .getX
//.Y is the target Y of the spell cast (it can be both ground and unit) it's basicly GetSpellTargetY() same for .X
local real angle = bj_RADTODEG * Atan2(.caster.getY() - .Y, .caster.getX() - .X)
//this is how I calculate the target x,y positions the projectiles need to go to.
//700 is the circle radius I think it needs to go there atleast<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" />
set x = .caster.getX() + 700 * Cos(angle)
set y = .caster.getY() + 700 * Sin(angle)
```

So these are my calculations and somehow the projectiles just fly to some random degree (though if I cast it at the same point the projectiles fly the same way).

So what am I doing wrong?

Thanks alot