Build a surface normal vector (I use Mathematica)

In summary, the conversation discusses a mathematical computation using the software Mathematica. The conversation includes the functions r, z, x, y, and S, and mentions the variable n. The individual is seeking clarification on their mistake in taking the final dot product and asks for help in understanding the purpose of the variable n.
  • #1
member 428835
Homework Statement
Given ##r(s) = \sin(c s)/c## we define the surface ##S = \langle r(s) \cos(\phi), r(s) \sin(\phi), (1 - \cos(cs))/c \rangle##. Compute a normal vector ##n## to ##S##.
Relevant Equations
a surface normal is found for a parametric surface ##S(s,\phi)## via ##n = d_sS \times d_\phi S##
Not HW, but seems to fit here.

I compute $$n.S = \frac{(-1+\cos(c s))}{c^2} \sin(c s) \neq 0$$

I use the following in Mathematica:

Code:
r[s_, \[Alpha]_] := Sin[Cos[\[Alpha]] s]/Cos[\[Alpha]]
z[s_, \[Alpha]_] := (1 - Cos[Cos[\[Alpha]] s])/Cos[\[Alpha]]
x[s_, \[CurlyPhi]_, \[Alpha]_] := r[s, \[Alpha]] Cos[\[CurlyPhi]]
y[s_, \[CurlyPhi]_, \[Alpha]_] := r[s, \[Alpha]] Sin[\[CurlyPhi]]
z[s_, \[CurlyPhi]_, \[Alpha]_] := z[s, \[Alpha]]
S[s_, \[CurlyPhi]_, \[Alpha]_] := {x[s, \[CurlyPhi], \[Alpha]],
  y[s, \[CurlyPhi], \[Alpha]], z[s, \[CurlyPhi], \[Alpha]]}
Cross[D[S[s, \[CurlyPhi], \[Alpha]], s],
   D[S[s, \[CurlyPhi], \[Alpha]], \[CurlyPhi]]].S[
   s, \[CurlyPhi], \[Alpha]] // FullSimplify

If you copy-paste this you should get the same output, where ##c = \cos(\alpha)##. What am I doing wrong? What is ##n##? Any help is greatly appreciated!
 
Physics news on Phys.org
  • #2
My mistake! Unsure why I was taking that final dot product: it obviously should not be zero except for rare spheres!
 

1. How do I build a surface normal vector using Mathematica?

To build a surface normal vector in Mathematica, you can use the function "SurfaceNormal" which takes in a set of points on the surface and returns the corresponding normal vectors. You can also use the "RegionNearest" function to find the closest point on the surface to a given point, and then calculate the normal vector at that point.

2. Can I customize the surface normal vector in Mathematica?

Yes, you can customize the surface normal vector in Mathematica by specifying the type of surface you are working with and the direction of the normal vector. You can also adjust the length and color of the normal vectors to make them more visible in your visualization.

3. Is it possible to calculate the surface normal vector for a 3D object in Mathematica?

Yes, you can calculate the surface normal vector for a 3D object in Mathematica by using the "RegionBoundary" function to extract the boundary of the object, and then applying the "SurfaceNormal" function to the boundary points. You can also use the "RegionMember" function to check if a given point is inside the object, and then calculate the normal vector at that point.

4. How accurate are the surface normal vectors calculated in Mathematica?

The accuracy of the surface normal vectors calculated in Mathematica depends on the accuracy of the input data and the method used to calculate the normals. If the input data is noisy or contains errors, the calculated normal vectors may not be completely accurate. It is important to carefully check and validate the results to ensure their accuracy.

5. Can I use surface normal vectors for other applications in Mathematica?

Yes, surface normal vectors can be used for various applications in Mathematica, such as shading and lighting in 3D visualizations, calculating surface curvature, and performing collision detection in simulations. They can also be used in conjunction with other functions and algorithms to analyze and manipulate 3D objects.

Similar threads

  • Calculus and Beyond Homework Help
Replies
3
Views
563
  • Calculus and Beyond Homework Help
Replies
10
Views
375
Replies
3
Views
649
  • Linear and Abstract Algebra
Replies
9
Views
873
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
1
Views
730
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
2
Replies
43
Views
3K
  • Introductory Physics Homework Help
Replies
8
Views
705
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
Back
Top