Nie martw się, rozumiem dokładnie, jak się czujesz. Zakładam, że chcesz trochę fragmentów kodu. więc możesz go wdrożyć we własnym zakresie. musisz wykonać znacznie więcej pracy, niż tylko dowiedzieć się o produkcie dot.
To do ciebie, aby zrozumieć ten algorytm i wdrożyć je w swoim programie co będę robić to daje implementację tego algorytmu
podpisał odległość między punktem a płaszczyzną
Oto przykładowe implementacje tych algorytmów "C++".
// Assume that classes are already given for the objects:
// Point and Vector with
// coordinates {float x, y, z;}
// operators for:
// Point = Point ± Vector
// Vector = Point - Point
// Vector = Scalar * Vector (scalar product)
// Plane with a point and a normal {Point V0; Vector n;}
//===================================================================
// dot product (3D) which allows vector operations in arguments
#define dot(u,v) ((u).x * (v).x + (u).y * (v).y + (u).z * (v).z)
#define norm(v) sqrt(dot(v,v)) // norm = length of vector
#define d(u,v) norm(u-v) // distance = norm of difference
// pbase_Plane(): get base of perpendicular from point to a plane
// Input: P = a 3D point
// PL = a plane with point V0 and normal n
// Output: *B = base point on PL of perpendicular from P
// Return: the distance from P to the plane PL
float
pbase_Plane(Point P, Plane PL, Point* B)
{
float sb, sn, sd;
sn = -dot(PL.n, (P - PL.V0));
sd = dot(PL.n, PL.n);
sb = sn/sd;
*B = P + sb * PL.n;
return d(P, *B);
}
Zrobione stąd: http://www.softsurfer.com/Archive/algorithm_0104/algorithm_0104.htm
PK
dlaczego dist = dotProduct (dif, dif)? odległość powinna wynosić: d (P, * B); ?? – Pavan
d (p, b) po prostu nazywa to = normą (sqrt (kropka (p - b, p - b))); –
Więc mój kod robi to samo. –