2015-03-31 69 views
1

我正在尝试从给定半径创建一个圆并翻译该圆。如何翻译圆上的一个点?

edia = 10; %diameter 
theta=linspace(0,2*pi, 100); %100 evenly spaced points. 
radius = edia./2; 
x = radius.*cos(theta); 
y = radius.*sin(theta); 
plot(x,y, 'k') 
axis equal 
axis([-edia, edia, -edia, edia]); 

使用代码创建一个圆后,我必须翻译它,但我不知道该怎么做。

这是圈子,我有

enter image description here

,这就是我想翻译

enter image description here

谢谢后得到的。

回答

2

对于这种简单的情况,只需直接添加换档即可。

Mathematica graphics

close all 
edia = 10; %diameter 
theta=linspace(0,2*pi, 100); %100 evenly spaced points. 
radius = edia./2; 
x = radius.*cos(theta); 
y = radius.*sin(theta); 
plot(x,y, 'k') 
axis equal 
axis([-edia, edia, -edia, edia]); 

newX=3; newY=4; 
hold on; 
plot(x+newX,y+newY, '-.')