Tuesday 31 January 2012

How to calculate the distance between a arbitrary point to a plane?

refer to ( http://mathworld.wolfram.com/Point-PlaneDistance.html  )
Point-Plane Distance
PointPlaneDistance
Given a plane
 ax+by+cz+d=0
(1)
and a point x_0=(x_0,y_0,z_0), the normal to the plane is given by
 v=[a; b; c],
(2)
and a vector from the plane to the point is given by
 w=-[x-x_0; y-y_0; z-z_0].
(3)
Projecting w onto v gives the distance D from the point to the plane as
D=|proj_(v)w|
(4)
=(|v·w|)/(|v|)
(5)
=(|a(x-x_0)+b(y-y_0)+c(z-z_0)|)/(sqrt(a^2+b^2+c^2))
(6)
=(|ax+by+cz-ax_0-by_0-cz_0|)/(sqrt(a^2+b^2+c^2))
(7)
=(|-d-ax_0-by_0-cz_0|)/(sqrt(a^2+b^2+c^2))
(8)
=(|ax_0+by_0+cz_0+d|)/(sqrt(a^2+b^2+c^2)).
(9)
Dropping the absolute value signs gives the signed distance,
 D=(ax_0+by_0+cz_0+d)/(sqrt(a^2+b^2+c^2)),
(10)
which is positive if x_0 is on the same side of the plane as the normal vector v and negative if it is on the opposite side.
This can be expressed particularly conveniently for a plane specified in Hessian normal form by the simple equation
 D=n^^·x_0+p,
(11)
where n^^=v/|v| is the unit normal vector. Therefore, the distance of the plane from the origin is simply given by p (Gellert et al. 1989, p. 541).
Given three points x_i for i=1, 2, 3, compute the unit normal
 n^^=((x_2-x_1)x(x_3-x_1))/(|(x_2-x_1)x(x_3-x_1)|).
(12)
Then the distance from a point x_0 to the plane containing the three points is given by
 D_i=n^^·(x_0-x_i),
(13)
where x_i is any of the three points. Expanding out the coordinates shows that
 D=D_1=D_2=D_3,
(14)
as it must since all points are in the same plane, although this is far from obvious based on the above vector equation.

Saturday 28 January 2012

4 new NAOs are joining our group

Hi everyone,

We just got 4 new "guys" involve our group. Actually they are really good at acting performance, even dance better than me.

Here is the video demo made by my colleague Inkyu Sa.