Code covered by the BSD License  

Highlights from
myfrenet

1.0

1.0 | 1 rating Rate this file 12 Downloads (last 30 days) File Size: 1.97 KB File ID: #22376
image thumbnail

myfrenet

by Mehmet OZTURK

 

10 Dec 2008

Construct tangent, normal and binormal vectors of a curve

| Watch this File

File Information
Description

Calculation of Tangent (T), Normal (N) and Binormal (B) of a continuous curve at every points of the curve.

function [T N B]=myfrenet(x,y,z,init)
% "x","y",and "z" is the coordinates of the curve. The curve also can be 2d.
% "init" is initial normal vector that user can be specified. With this input, you can freely initialize your vectors.

Although the name of the function is "myfrenet", the vectors are calculated in a different way from "frenet" equations because of some discontinuities of "frenet".

Derrivatives of the curve are calculated with spline fitting, therefore spline toolbox are required. If the toolbox are not available, users can change the derrivative calculation method such as by using "diff" or "gradient" command.

% Example
clear,clc
t=2*pi*linspace(-1/2,1/2,100).';
 x=cos(t); y=sin(t); z=t;
myfrenet(x,y,z)

Required Products Spline Toolbox
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
14 Jul 2011 svetlana  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
tangent Mehmet OZTURK 10 Dec 2008 16:05:16
normal Mehmet OZTURK 10 Dec 2008 16:05:16
binormal Mehmet OZTURK 10 Dec 2008 16:05:16
frenet Mehmet OZTURK 10 Dec 2008 16:05:16
curve Cristina McIntire 12 Dec 2008 15:40:11
points Cristina McIntire 12 Dec 2008 15:40:11

Contact us at files@mathworks.com