Showing posts with label Geometry. Show all posts
Showing posts with label Geometry. Show all posts

Monday, December 7, 2009

Mimimum distance from point to a curve

1. Assume we already know the function of curve: y=f(x); Given a point p(x1,y1), calculate the minimum distance:

D=sqrt((x-x1)^2+(y-y1)^2);

D*=(x-x1)^2+(y-y1)^2;

substitute y by f(x);

D*=(x-x1)^2+(f(x)-y1)^2;

Compute the derivative of D* and set it to zero: D*'=0, then we can solve x; substitute x , we get minimum distance D*;

2. The other one is no function expression of curve. We need calculate all points.

Monday, March 9, 2009

Combination translation and rotation

The order is very important, so rotation before translation is different translation after rotation.
Of course , rotation matrix also can not change the order ...

Remember that..