Displaying 4 results from an estimated 4 matches for "nmag".
Did you mean:
nag
2020 Oct 23
2
3d plot of earth with cut
...<- p1x - p0x # P
v1y <- p1y - p0y
v1z <- p1z - p0z
v2x <- p2x - p0x # P0
v2y <- p2y - p0y
v2z <- p2z - p0z
# The cross product will give a vector orthogonal to the plane, (nx, ny, nz)
nx <- v1y*v2z - v1z*v2y;
ny <- v1z*v2x - v1x*v2z;
nz <- v1x*v2y - v1y*v2x;
# normalize
nMag <- sqrt(nx*nx + ny*ny + nz*nz);
nx <- nx / nMag;
ny <- ny / nMag;
nz <- nz / nMag;
# Plane equation (vec(P) - vec(P0)) * vec(n) = 0, with P=(x, y, z), P0=(x0,
y0, z0),
# giving a*(x-x0)+b*(y-y0)+c*(z-z0) = 0, where x,x0 are two points in the
plane
# a, b, c are the normal vector coordi...
2020 Oct 23
0
3d plot of earth with cut
...p1z - p0z
> v2x <- p2x - p0x # P0
> v2y <- p2y - p0y
> v2z <- p2z - p0z
>
> # The cross product will give a vector orthogonal to the plane, (nx, ny, nz)
> nx <- v1y*v2z - v1z*v2y;
> ny <- v1z*v2x - v1x*v2z;
> nz <- v1x*v2y - v1y*v2x;
> # normalize
> nMag <- sqrt(nx*nx + ny*ny + nz*nz);
> nx <- nx / nMag;
> ny <- ny / nMag;
> nz <- nz / nMag;
>
> # Plane equation (vec(P) - vec(P0)) * vec(n) = 0, with P=(x, y, z), P0=(x0,
> y0, z0),
> # giving a*(x-x0)+b*(y-y0)+c*(z-z0) = 0, where x,x0 are two points in the
> plan...
2020 Oct 22
0
3d plot of earth with cut
> It should be a 2D slice/plane embedded into a 3D space.
I was able to come up with the plot, attached.
My intention was to plot national boundaries on the surface of a sphere.
And put the slice inside.
However, I haven't (as yet) worked out how to get the coordinates for
the boundaries.
Let me know, if of any value.
And I'll post the code.
(But needs to be polished first)
2020 Oct 22
2
3d plot of earth with cut
Thanks for your idea. It should be a 2D slice/plane embedded into a 3D
space. Could be static, I just need to make a single figure from it for
illustration of the Earth together with its interior in 3D. So, the
interior would be a slice in 2D along a fixed longitude. And along this 2D
slice would be a heatmap. Again, embedded in 3D, since it would be shown as
a slice of Earth in 3D.
Duncan?s