# Finding angles between 2 3d points

**URL:** <https://forum.kirupa.com/t/finding-angles-between-2-3d-points/232457>\
**Category:** Uncategorized\
**Created:** [July 13, 2007, 9:45pm UTC](https://forum.kirupa.com/t/finding-angles-between-2-3d-points/232457 "2007-07-13T21:45:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enebreus](https://avatars.discourse-cdn.com/v4/letter/e/f475e1/32.png) [@Enebreus](https://forum.kirupa.com/u/Enebreus)\
**Post date:** [July 13, 2007, 9:45pm UTC](https://forum.kirupa.com/t/finding-angles-between-2-3d-points/232457/1 "2007-07-13T21:45:52Z")

</div>

Hey all, I’m stumped.

I’m trying to find the 2 (radian) angles between 3D points for example (0, 0, 0) --\> (10, 10, 30)

I enlisted the help of a guy from work and came up with:

```auto

var dz:Number = lObj.myX-cView.camX;
var dy:Number = lObj.myY-cView.camY;
var dx:Number = lObj.myZ-cView.camZ;
 B =Math.asin(dz/Math.sqrt(dx*dx+dy*dy+dz*dz));
 A =Math.asin(dy/Math.sqrt(dx*dx+dy*dy));

```

(lObj is the object I’m moving towards. cView is the position of my viewer/camera.)

This seems to work, until my dx value goes into the negatives, then it just kinda goes crazy 😛

Is there a more widely accepted way of finding the two angles?  
I’d really appreciate it if someone could furnish me with an example, I’ve been trying to Google a solution for about two hours, although I’ve run across several promising leads most are over my head.
