# Dynamic 3D distance calculation

**URL:** <https://forum.kirupa.com/t/dynamic-3d-distance-calculation/279392>\
**Category:** Uncategorized\
**Created:** [January 14, 2009, 9:04am UTC](https://forum.kirupa.com/t/dynamic-3d-distance-calculation/279392 "2009-01-14T09:04:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bed718](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@bed718](https://forum.kirupa.com/u/bed718)\
**Post date:** [January 14, 2009, 9:04am UTC](https://forum.kirupa.com/t/dynamic-3d-distance-calculation/279392/1 "2009-01-14T09:04:21Z")

</div>

Got another tough one for you all the gurus out there… :genius: senocular??

Is there a way to calculate the distance between the origin of a movieClip at, say, (x:500, y:0, z:0) and one at, (x:500, y:0, z:50)?? And lets say the vanishing point is (0,0) and the perspective angle is 50.

I know that the eq for finding the distance between two points in 3D space is:  
d = ((x1-x2)^2 +(y1-y2)^2+(z1-z2)^2)^(1/2)

the problem is I dont know x2 (the x value of MC2 (the one set at z = 50)).

see: [http://b-ed.com/perspectiveTetst.swf](http://b-ed.com/perspectiveTetst.swf)  
also: [http://b-ed.com/perspectiveTetst.jpg](http://b-ed.com/perspectiveTetst.jpg)

any help would be great

-=b=-
