Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: curvature of circle through three points
Replies: 5   Last Post: Feb 3, 2006 12:27 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
joa

Posts: 182
Registered: 11/3/05
Re: curvature of circle through three points
Posted: Feb 3, 2006 11:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Because it's Friday.


function k = kfrom3points(xs,ys);

%KFROM3POINTS Calculate curvature of a circle given 3 points

%

% K = KFROM3POINTS(XS,YS)

% Where

% XS holds 3 x values

% YS holds 3 y values

% Then

% K is the curvature of the circle through the points


xs=xs(:); % columnize xs

ys=ys(:); % columnize ys


os = ones(3,1);

ss = xs.^2+ys.^2; % sum of squares


a = det([xs ys os]); % Eq. 31

d = -det([ss ys os]); % Eq. 32

e = det([ss xs os]); % Eq. 33

f = -det([ss xs ys]); % Eq. 34


r = sqrt((d^2+e^2)/(4*a^2)-(f/a)); % Eq. 30

k=1/r; % curvature





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.