09-07-2015 05:09 PM
Unfortunately, two points (P1 and P2') determine a line, but not a plane. There are an infinite number of planes parallel to the line P1-P2' -- indeed, consider any plane that includes this line (an infinite number) and all planes parallel to these infinite planes.
Here's a question -- do you know that each of your trajectories lie on a plane? If so, you could consider determining the plane that contains P1 and P2 (two points on your trajectory, chosen "far apart") and is the "best fit" for the points in between. Alternatively, you could determine the plane that best fits all of your points, and then plot the projection of each point onto this plane (if all of the points really did lie on the plane, the projection would simply be the points themselves).
This is a slightly more difficult problem, of course. Again, it is a Math problem, not a LabVIEW problem. Anyone around where you are that knows some mathematics? A smart engineer? A smart college student in Math or the sciences? A Web search on fitting a plane through a cloud of points?
Bob Schor
09-07-2015 05:32 PM
That's a very pretty diagram, but the conventional orientation of SPC (Spherical Polar Coordinates), as I noted in my earlier answer, has Phi as the angle measured in the XY plane of the projection of P into the XY plane (i.e. P' lies not in the XZ plane, but in the XY plane), with Theta being the angle that P makes with the Z axis. Here's the picture of the usual SPC convention:
However, this picture is simply a convention -- the scheme you showed in your post could also be considered SPC. The question is -- which scheme does LabVIEW use in its Polar-Spherical conversion routine?
I must confess that I didn't really know, so I wrote a simple test VI that input the three unit coordinate axes and asked LabVIEW to return me the Spherical Polar Coordinates. The numbers it returned are consistent with the picture shown in this post -- the coordinates for (1, 0, 0) (the unit X axis) were (1, 0, pi/2), for Y were (1, pi/2, pi/2), and for Z were (1, 0, 0).
Bob Schor
09-07-2015 06:06 PM - edited 09-07-2015 06:09 PM
Can you please post your real data? [Edit: Post it as a tab-delimited text file or a VI with the data saved as default in a control or indicator.] The data in the image in your first post in this thread is just noise over the first 24 frames.
If we have your actual data, there is a much better chance that someone can help.
Lynn
09-08-2015 04:31 AM
@Bob_Shor
Thanks for your answer. About determining the plane: the points didn't lie in one plane becasue of particles rotations and You've got right about idea with plane that best fits all of points. It's true that this Math problem, but in this thread I also was trying to find ready tools in LabView to do this things.
@johnsold
Here is data with one trajectory (with XYZ positions). Take a look at this.
09-08-2015 10:57 AM
Your data is very close to linear in X and Z and fits a second order polynomial in Y quite well. This is consistent with the behavior of a massive particle in a gravity field where the force due to gravity is in the -Y direction or a charged particle in an electrical field parallel to the Y axis.
Does that model fit the physical behavior of your system? If so, then the slopes of the X and Z data along with the initial slope of the Y polynomial give you vectors in 3-dimensional space that should define your angles completely.
Note that in the image the data is offset by subtracting the minimum values on each axis from the array of values for that axis. It is a little easier to visualize the curvature because the scales are similar. Only the offset coefficient changes in the polynomial coefficients, as expected.
Lynn