In Away3d development, it is sometimes necessary to compute the distance or midpoint between two points (Vector3D). Suppose to have the following V1, v2 two coordinate points.
Distance between 1 and two points (length of segment)
var v1:vector3d = new Vector3D (0,0,0);
var v2:vector3d = new Vector3D (200,200,200);
var lenght:number = v1.subtract (v2). length; 346.41016151377545
Midpoint between 2, two points (midpoint of line)
var v1:vector3d = new Vector3D (0,0,0);
var v2:vector3d = new Vector3D (200,200,200);
Method 1
var v3:vector3d = new Vector3D (v1.x+v2.x)/2, (V1.Y+V2.Y)/2, (V1.Z+V2.Z)/2);
Method 2
var Temv:vector3d = V1.add (v2);
var v3:vector3d = new Vector3D (TEMV.X/2, TEMV.Y/2, TEMV.Z/2);
Well, the above is a small series for you to sort out an article on the calculation of two points (Vector3D) between the distance or midpoint of the example, I hope to help you oh.