如何创建任意共面3d曲线的2d图 [英] How to create 2d plot of arbitrary, coplanar 3d curve
问题描述
- 找到最接近这些点共面的平面
- 以这样的方式将这些点投影到该平面上,使我获得二维曲线
我相信我知道该怎么做的第二点,实际上我主要是在努力的第一点,但是我也不会介意在第二点上提供帮助.
一吨!
-
在数据中找到3个点
A,B,C
它们不得位于同一行上,并且应尽可能地彼此隔开以提高准确性.
-
构造
U,V
基向量U = B-A V = C-A
规范化
U /= |U| V /= |U|
使
U,V
垂直W = cross(U,V) // this will be near zero if A,B,C are on single line U = cross(V,W)
-
将您的数据转换为
U,V
平面仅针对数据计算中的任意点
P=(x,y,z)
:x' = dot(U,P) y' = dot(V,P)
如果您还需要反向转换:
P = x'*U + y'*V
如果您要/有一个原点
A
,则转换为:x' = dot(U,P-A) y' = dot(V,P-A) P = A + x'*U + y'*V
这将在您的2D坐标中将
A
映射到(0,0)
.
如果您不知道向量数学,请看这里:
在底部,您将找到矢量运算的方程式.希望对您有帮助...
I have a set of points which comprise a (in theory) co-planar curve. My problem is that the plane is arbitrary and can move between each time I collect the data (these points are being collected from a camera). I was wondering if you guys could help me figure out how to:
- find the plane which is closest to the one which these points are co-planar on
- project the points on this plane in such a way that gives me a 2-d curve
I believe that I know how to do point 2, it is really mainly point 1 that i'm struggling with, but I wouldn't mind help on the second point as well.
Thanks a ton!
find 3 points
A,B,C
in your dataThey must not be on single line and should be as far from each other as possible to improve accuracy.
construct
U,V
basis vectorsU = B-A V = C-A
normalize
U /= |U| V /= |U|
make
U,V
perpendicularW = cross(U,V) // this will be near zero if A,B,C are on single line U = cross(V,W)
convert your data to
U,V
planesimply for any point
P=(x,y,z)
in your data compute:x' = dot(U,P) y' = dot(V,P)
in case you need also the reverse conversion:
P = x'*U + y'*V
In case you want/have an origin point
A
the conversions would be:x' = dot(U,P-A) y' = dot(V,P-A) P = A + x'*U + y'*V
That will map
A
to(0,0)
in your 2D coordinates.
In case you do not know your vector math look here:
at the bottom you will find the equation for vector operations. Hope that helps ...
这篇关于如何创建任意共面3d曲线的2d图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!