最小二乘法平面拟合
在介绍平面拟合之前,我先给大家介绍一下有关平面的相关知识(相关介绍来自QVPak 3D,日本三丰)
Definition of the Plane Feature
A plane feature is reported as the projection of the centroid of the points ud to fit the plane, which is projected onto the plane feature, a measurement of the direction measured as an angle, a measurement of the flatness of the plane and a measurement of the parallelism of the plane. If measured in a Cartesian coordinate system, the coordinates of the plane's centroid are reported as follows:
X: The distance from the origin to the centroid, as measured along the x-axis.
Y: The distance from the origin to the centroid, as measured along the y-axis.落木千山天远大
Z: The distance from the origin to the centroid, as measured along the z-axis.
If measured in a Cylindrical coordinate system, the coordinates of the plane's centroid are reported as follows:
R: The distance from the z-axis of the coordinate system to the centroid, as measured within a plane which contains the centroid and is orthogonal to the z-axis of the coordinate system.
A: The direction, measured as an angle, between a reference radius vector and a radius vector that contains the centroid and is projected onto the xy-plane. The reference radius vector may be considered to be the x-axis. Z: The height from the origin to the centroid in the cylindrical coordinate system, as measured along the z-axis.
The other attributes of the plane feature are:
Angle: The angle between the projection of the plane’s normal vector onto the xy-plane and the x-axis of the current coordinate system.
X-angle: The angle between the plane’s normal vector and the x-axis of the current coordinate system. (X-Angle = arc cosine k). The x-angle is a positive number between 0 and 180 degrees.
Y-angle: The angle between the plane’s normal vector and the y-axis of the current coordinate system. (Y-Angle = arc cosine l). The y-angle is a positive number between 0 and 180 degrees.
Z-angle: The angle between the plane’s normal vector and the z-axis of the current coordinate syste
m. (Z-Angle = arc cosine m). The z-angle is a positive number between 0 and 180 degrees.
Flatness: Flatness is a condition for which an element of a surface is in a plane.
Flatness is reported as the width of the zone formed by two clost parallel planes that fully contain the point t ud to fit the plane feature. A value of zero indicates perfect flatness.
Flatness (minimum): The distance from the fitted plane to the measured point farthest below the fitte
d plain in the point t. Above and below are determined by the direction of the plane vector. See Explanation of Max/Min distance in different cas.董力女儿
Flatness (maximum): The distance from the fitted plane to the measured point farthest above the fitted plain in the point t. Above and below are determined by the direction of the plane vector. See Explanation of Max/Min distance in different cas.
Parallelism: The condition of a feature, projected to a certain plane, being equidistant at all elements from a datum (reference). Quantitatively, parallelism is defined as the absolute distant difference between the farthest and clost points from the datum.
笠组词Parallelism is evaluated relative to a reference line or xy-plane. When evaluating a t of points with a reference line, parallelism us the projections of the points and reference line onto the xy-plane in the current coordinate system, or z/ref plane feature, and is specified as a zone tolerance. The z/ref plane feature is a plane including the reference line and parallel to (or including) the z-axis. When evaluating a t of points with a xy-plane, parallelism is calculated in three-dimensional space.
措词
Parallelism (minimum): The distance from the referenced line or plane to the point in the point t with the least value (least positive value if all evaluated points are positive, or most negative value if
evaluated
points include negative values). See Explanation of Max/Min distance in different cas.
Parallelism (maximum): The distance from the reference line or plane to the point in the point t with the greatest value (most positive value if evaluated points include positive values, or least negative value if all evaluated points are negative). See Explanation of Max/Min distance in different cas.
平面相关知识:
算法如下:
VB源代码:
Option Explicit
Public Const PI = 3.1415926535897
Public Type tagPoint
x As Double
y As Double
煎好的中药放冰箱能放多久z As Double
End Type
Public Type tagLine2D家族群名称大全
音阶是什么k As Double 'Slope ,K is the "K" of "y=kx+b"
b As Double 'intercept,B is the "B" of "y=kx+b" Angle As Double 'arctg(k) '0 to 180 deg
Straightness As Double
RSQ As Double
安全寄语亲人嘱托End Type
Public Type tagLine3D
'3D line's formula is showing as following.