如何在MatLab中找到曲线上某点的法线向量 [英] How to find the normal vector at a point on a curve in MatLab

查看:2084
本文介绍了如何在MatLab中找到曲线上某点的法线向量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一条曲线,我想在这条曲线的给定点上找到法线向量,后来我必须找到该法线向量与另一个向量的点积.

I have a curve and I want to find the normal vector at a given point on this curve, later I have to find the dot product of this normal vector with another vector.

我尝试了MatLab的梯度函数,但是当我们仍然需要确定特定点的梯度时,我猜想它是行不通的.

I tried the gradient function of MatLab, but I guess it doesnt work when we need to find the gradient at a specific point still I am not sure if I am wrong.

请指导我如何在MatLab中实现这一目标.

Please guide me how can I achieve this in MatLab.

谢谢.

推荐答案

使用此

如果定义dx = x2-x1和dy = y2-y1,则法线为(-dy,dx)和(dy,-dx).

if we define dx=x2-x1 and dy=y2-y1, then the normals are (-dy, dx) and (dy, -dx).

这是使用y = x^2

x = 0:0.1:1;
y = x.*x;
dy = gradient(y);
dx = gradient(x);
quiver(x,y,-dy,dx)
hold on; plot( x, y)

给出:

PS: 抱歉,切线示例!!!赶时间.感谢Schorsch和Shawn314!

PS: Sorry about the tangential example!!! Got in a hurry. Thanks to Schorsch and Shawn314!

这篇关于如何在MatLab中找到曲线上某点的法线向量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆