[Scilab-users] Rotate an xarc figure
Dang, Christophe
Christophe.Dang at sidel.com
Thu Dec 20 09:06:11 CET 2012
Thanks Denis and Samuel.
I personally used the following solution.
Feel free to criticize if there is something to improve.
function [] = trace_ellipse(xc, yc, a, b, phi)
// trace l'ellipse de centre (xc, yc)
// de rayons a et b et tournée de phi
pas = 0.1;
t = 0:pas:%pi/2;
X = a*cos(t);
Y = b*sin(t);
n = 4*size(X,'*');
XY1 = [X, -flipdim(X,2), -X, flipdim(X,2);...
Y, flipdim(Y,2), -Y, -flipdim(Y,2)];
XY = rotate(XY1, phi) + [xc*ones(1,n);yc*ones(1,n)];
xpoly(XY(1,:), XY(2,:));
endfunction
--
Christophe Dang Ngoc Chan
Mechanical calculation engineer
Sidel Group
Sidel Blowing & Services
Avenue de la Patrouille de France
Octeville-sur-Mer, BP 204
76053 Le Havre cedex, France
Tel: 33(0)2 32 85 89 32
Fax: 33(0)2 32 85 91 17
<http://www.sidel.com/>
<mailto:christophe.dang at sidel.com>
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
More information about the users
mailing list