The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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



% 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.