MATLAB: How to find the normal to a hemisphere surface
hemispherenormal
How do i find the normal to a hemisphere surface with radius r = 6, and center point
c = [2,1,3];
Best Answer
Think about what the normal vector means. It points straight out from the hemisphere. What other known point is on the same line? (Hint: What do you know about the center of the sphere? What property does it have?)
That means, from ANY point on the surface of the hemisphere, call it [x,y,z], the normal vector is as simple as:
C = [2 1 3];
normalvec = [x y z] - C;
This vector is normal to the surface, and points outwards. Just negate the vector if you want it to be inward pointing.
It is hard to find the intersection of a surface and a plane (in general), as it is explainedhere by Patrikalakis et al. And it may be harder to obtain a smooth curve.
But if you can do with a number of points on the (branches of the) curve(s), you can:
Find the scalar functiond of the distance from the points on the surface to the plane
Compute the contour lines ofd of value0,keeping the output of the function:
C = contour(x, y, d, [0 0]);
InC you can find all the points on the surface which belong to the intersection, see the documentation here:ContourMatrix property
Best Answer