HaxeFlixel/flixel — pull request #1143 by Gama11 (2014-05-31 15:18:49+00:00)
Title: FlxAngle.rotatePoint() -> FlxPoint#rotate(), FlxAngle.getAngle() -> FlxPoint#angleBetween()

This makes sense because these are functions that operate *on* `FlxPoint`. There is no reason for these to be located in a static utility class. Otherwise you end up having to pass the `x` and `y` of a point around individually, which kind of defeats the point (no pun intended).

Moving these to `FlxPoint` greatly reduces their function signature (`rotatePoint()` went from 6 parameters (one optional) to only 2 (!).

I think it makes for much more readable code. The code snippet I posted [here](https://github.com/HaxeFlixel/flixel/pull/1075#issuecomment-44750129) now becomes this:

```haxe
package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.math.FlxAngle;
import flixel.system.scaleModes.FixedScaleMode;
using flixel.util.FlxSpriteUtil;

class PlayState extends FlxState
{
var sprite = new FlxSprite();
var pivot = new FlxSprite(200, 200);

override public function create():Void
{
FlxG.scaleMode = new FixedScaleMode();
add(sprite.screenCenter());
add(pivot);
}

override public function update():Void
{
super.update();

var playerPosition = sprite.toPoint();
playerPosition.rotate(pivot.toPoint(), 3);
sprite.setPosition(playerPosition.x, playerPosition.y);
}
}
```

As you can see, this combo's very nicely with `FlxObject#toPoint()` I added [here](https://github.com/HaxeFlixel/flixel/commit/6fdbbaf2b5830dfab5826e4fce6204f5c1fa7607). The only thing that's bothering me a little here is that there's no way to set the position of a `FlxObject` via a point. Maybe we should add `FlxObject#setPositionByPoint()`? That strikes me as too verbose though.