Question: I have 2 objects and when I move one, I want to get the angle from the other.

For example:

```
Object1X = 211.000000, Object1Y = 429.000000
Object2X = 246.500000, Object2Y = 441.500000

```

I have tried the following and every variation under the sun:

```
double radians = ccpAngle(Object1,Object2);
double degrees = ((radians * 180) / Pi); 

```

But I just get 2.949023 returned where I want something like 45 degrees etc.

Answer: 
Does this other answer help?

[How to map atan2() to degrees 0-360](https://stackoverflow.com/questions/1311049/how-to-map-atan2-to-degrees-0-360)

I've written it like this:

```
- (CGFloat) pointPairToBearingDegrees:(CGPoint)startingPoint secondPoint:(CGPoint) endingPoint
{
    CGPoint originPoint = CGPointMake(endingPoint.x - startingPoint.x, endingPoint.y - startingPoint.y); // get origin point to origin by subtracting end from start
    float bearingRadians = atan2f(originPoint.y, originPoint.x); // get bearing in radians
    float bearingDegrees = bearingRadians * (180.0 / M_PI); // convert to degrees
    bearingDegrees = (bearingDegrees > 0.0 ? bearingDegrees : (360.0 + bearingDegrees)); // correct discontinuity
    return bearingDegrees;
}

```

Running the code:

```
CGPoint p1 = CGPointMake(10, 10);
CGPoint p2 = CGPointMake(20,20);

CGFloat f = [self pointPairToBearingDegrees:p1 secondPoint:p2];

```

And this returns 45.

Hope this helps.
I modified @tomas' solution to be streamlined. It's likely (it was for me) that this math is going to be called frequently.

In my incarnation, you have to perform the difference between the two points yourself (or if you're lucky, (0,0) is already one of your points). The value being calculated is the direction of the point from (0,0). Yes, that's simple enough and you could inline it if you really want to. My preference is for more readable code.

I also converted it to a function call:

```
CGFloat CGPointToDegree(CGPoint point) {
  // Provides a directional bearing from (0,0) to the given point.
  // standard cartesian plain coords: X goes up, Y goes right
  // result returns degrees, -180 to 180 ish: 0 degrees = up, -90 = left, 90 = right
  CGFloat bearingRadians = atan2f(point.y, point.x);
  CGFloat bearingDegrees = bearingRadians * (180. / M_PI);
  return bearingDegrees;
}

```

If you don't want negative values, you need to convert it yourself. Negative values were fine for me - no need to make unneeded calculations.

I was using this in a cocos2d environment, this is how I call it: (Mathematically, we are translating the plane to make `p0` the origin. Thus subtracting `p0` from `p1` (`p0` - `p0` = {0,0}). The angles are unchanged when the plane is translated.)

```
CGPoint p0 = self.position;
CGPoint p1 = other.position;
CGPoint pnormal = ccpSub(p1, p0);
CGFloat angle = CGPointToDegree(pnormal);

```

`ccpSub` is provided by cocos2d, it's subtraction of a tuple - you can do that yourself if you don't have that available

aside: it's generally not polite style to name the method as above with the `CG___` naming scheme, which identifies the function as part of `CoreGraphics` - so if you want to rename it to `MyConvertCGPointToBearing()` or `FredLovesWilma()` then you should do that.