"Matt J" wrote in message <email@example.com>... > "Myles" wrote in message <firstname.lastname@example.org>... > > > > > > > > Try this formula for deg instead > > > > > > deg=atan2(norm(u),Ztilt(3))*180/pi > > > > Unfortunately that didn't work either. > ============= > > If that's the case, I'm starting to wonder whether you're using the correct normal Ztilt. As a recap, here is the code we're using > > Ztilt = [0.1682 0.3477 -0.9224]; > u = cross(Ztilt, [0 0 1]); > deg=atan2(norm(u),Ztilt(3))*180/pi; > > NewPoint = AxelRot(Ztilt', deg, u, [0 0 0]) > > > When I run this, I obtain > > NewPoint = > > -0.0000 > -0.0000 > 1.0000 > > In other words, the normal to your original plane Ztilt is being correctly rotated so as to be parallel to the z-axis. Your points have to remain in a plane perpendicular to Ztilt after rotation, so they have to end up in a plane parallel to the xy-plane, if Ztilt is indeed the correct normal. > > It may help if you list some of the points in your data set so that we can test whether they indeed lie in a plane normal to the Ztilt you've given.
I've just checked a few points - they're not EXACTLY on the plane, but their distance from the plane is within 0.1 accurate - will this make a large difference? Here's the points which generated the plane:
And here are a few test points: [22.3129 34.3892 25.2255] ~ 0.0624 'units' away from the plane [22.6382 34.4658 25.2255]
I can't define units that well since I'm dealing with 3D ultrasound images, but I still think this is a relatively small number, and if it gives me reasonably close x/y coordinates I can just delete the z after and lose a little precision.