> dp = DotProduct(px, py, pz, nx, ny, nz) // I know the formula above said
> N.P (and this is P.N) but the N.P produced results off the chart for me
The dot product operation is commutative. It shouldn't matter what order
you put them into your dot product routine. Make sure your dot product
method is performing correctly.
If you input two unit length vectors 30 degrees apart, then the dot
product should be the cosine of 30 degrees.
(0.8660254, 0.5), (1.0, 0.0)