Unit normal vector on an arbitrary curve

2 visualizaciones (últimos 30 días)
MINAS KOUROUMPLAKIS
MINAS KOUROUMPLAKIS el 11 de Dic. de 2020
Editada: jessupj el 11 de Dic. de 2020
I need the unit normal vectors on a rounded triangle curve. I use an algorithm which was written by an idea in this forum and a Khan academy videoand is the following. I think though that it has flaws which at certain cases leads to false results e.g. boundary conditions. Does anyone know a very accurate method of finding these uniti normal vectors on a curve?
The code:
for j=1:1:N
f(j)=2*pi*(j-1)/N;
end
x=6.25*g*(cos(f)+a*cos(2*f));
y=6.25*g*(sin(f)-a*sin(2*f));
dy = gradient(y);
dx = gradient(x);
norm=sqrt(dx.^2+dy.^2);
nx=dy./norm;
ny=-dx./norm;
  1 comentario
jessupj
jessupj el 11 de Dic. de 2020
Editada: jessupj el 11 de Dic. de 2020
using 'norm' as a variable name is somewhat bad practice since you might want to use the norm() function at some point when dealilng with coordinate geometry.
isn't the unit normal you want here simply the normalized negative reciprocal of dy/dx computed from the function, like -dx./dy / sqrt(dx.^2./dy/dy) ?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Productos


Versión

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by