필터 지우기
필터 지우기

arc question about implementing angle using linspace

조회 수: 10 (최근 30일)
Amal Fennich
Amal Fennich 2020년 3월 17일
편집: Adam Danz 2020년 3월 19일
r_angl = linspace(pi/4, 3*pi/4, N);
what does this mean? because I have an angle of 3.433 degree and I do not know how to implement it here ! any help ?
  댓글 수: 2
madhan ravi
madhan ravi 2020년 3월 17일
what is your question? could you rephrase it?
Adam Danz
Adam Danz 2020년 3월 19일
편집: Adam Danz 2020년 3월 19일
"what does this mean?"
Check out the linspace page in the documentation. That line is basically creating N points between (1/4)pi (45 deg) and (3/4)pi (135 deg).
Check out madhan ravi's answer to convert deg<==>rad. Here's a summary:
  • deg = rad * 180/pi
  • deg = rad2deg(rad)
  • rad = deg * pi/180
  • rad = deg2rad(deg)

댓글을 달려면 로그인하십시오.

답변 (1개)

madhan ravi
madhan ravi 2020년 3월 17일
if you are looking to convert radians to degrees use the function rad2deg() function
  댓글 수: 1
Amal Fennich
Amal Fennich 2020년 3월 17일
I have to draw an arc in Matlab which is going to represent half of airfoil .
the slope of the arc is dy/dx=(69.722-x^2+x-0.25)^-1/2(-x+1/2)
theta =3.433 degree
R=2.35
center is (0.5,-2.335)
someone has posted this code for arc and I have made slite changes on it but I do not know if I have resepted the requirements that I have :
circr = @(radius,rad_ang,p0) [radius*cos(rad_ang)+0.5; radius*sin(rad_ang)-2.335]; % Circle Function For Angles In Radians % Circle Function For Angles In Radians
circd = @(radius,deg_ang) [radius*cosd(deg_ang); radius*sind(deg_ang)]; % Circle Function For Angles In Degrees
N = 40; % Number Of Points In Complete Circle
r_angl = linspace(pi/4, 3*pi/4, N); % Angle Defining Arc Segment (radians)
radius = 2.35; % Arc Radius
xy_r = circr(radius,r_angl); % Matrix (2xN) Of (x,y) Coordinates
figure(1)
plot(xy_r(1,:), xy_r(2,:)) % Draw An Arc
axis([-1.25*radius 1.25*radius 0 1.25*radius]) % Set Axis Limits
axis equal

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Automotive에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by