MATLAB: Radius and centre of curvature

MATLABmatlab 2020aradius of curvature

Can anyone say
why it is showing inf as output as shown in the screenshot attached, when I ask radius and centre of curvature for sqrt(X)+sqrt(y)==sqrt(a),when x = 3???
Why it is not showing a numerical value???
Kindly solve this problem.

Best Answer

Hi Nagaraj,
You will have to first change your equation to the form of y = f(x) and then use the formulae to find the radius and center of curvature. The code is given below for your reference:
syms y(x) a
y(x) = (sqrt(a)-sqrt(x))^2; % Re-arranged the equation
x1 = 3;
c1 = x - (diff(y,x)*(1+(diff(y,x))^2))/diff(y,x,2);
c1 = c1(x1) % Found x-coordinate of center of curvature
y1 = y(x1);
c2 = y + (1+(diff(y,x))^2)/diff(y,x,2);
c2 = c2(y1) % Found y-coordinate of center of curvature
Center = [c1,c2];
Point = [x1,y1];
Radius = ((x1-c1)^2 + (y1-c2)^2) % Distance between the point and the center gives radius of curvature
For additional information on the 'diff' function, refer to the following link:
Regards,
Divija
Related Question