First off apologies for the crude drawing, I am by no means well versed in 3D manipulation and have only a very basic understanding of matrices, so please explain everything as clearly as you can and make no assumptions of my level of knowledge.
I am currently gathering longitude and latitude data and converting it into Cartesian X,Y and Z with the following function:
public CartesianXYZ LonLat2Cartesian(double lon, double lat)
{
CartesianXYZ XYZ = new CartesianXYZ();
var R = 6371000;
XYZ.X = Convert.ToInt32(R * Math.Cos(lat) * Math.Cos(lon));
XYZ.Y = Convert.ToInt32(R * Math.Sin(lat) * Math.Cos(lon));
XYZ.Z = Convert.ToInt32(R * Math.Sin(lat));
return XYZ;
}
When plotting these on a graph, I have found that the Y axis varies quite significantly, even though these points are very close to each other, I assume this is due to the fact we are sat on a sphere and unless I was at the north pole, it would be considered slanted, more so the closer to the equator I was. (If this is not the case please do let me know)
Please see the below three points plotted in a 3D scatter graph
Point A would be considered the "central" point where the user is
Point B is a point directly to the south of the user
Point C is a point directly to the north of the user
What I hope to achieve is to rotate points B and C around point A, so that their Y values are the same and I can consider the graph a 2D representation of the points, I found by just changing the Y to the same I ended up with a fairly skewed version of the points.
The end goal is to use the heading of the user and find out if any of the points are within their field of view (for augmented reality)
Any assistance, helpful critique or links to useful articles would be greatly appreciated.