2015-03-31 71 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, '-.')