0
四捨五入的角度我知道以下內容:2D-位置圓的,用於OpenSCAD
- P(x,y座標)。
- A1和A2(以度數表示的角度)
- R(圓的半徑)。
現在我需要計算的綠色圓圈中心,以使其「tangentize?兩條藍線(稍後將與其他形狀一起構成一個圓角三角形的點)。
任何幫助將不勝感激!
我對所描繪的示例代碼:
//KNOWNS
P=[-3.0,1.0,0.0];
A1=60; A2=-5;
R=5;
//UNKNOWN
SECRET_CALCULATION = [8.2,4.3,0];//???
//ILLUSTRATION
C0=[0,0,0,1]; C1=[0,1,1,0.3]; C2=[0,1,0,0.4]; C3=[1,0,0,0.4];//Colors
translate(P){
color(C1) rotate(A1) translate([0,-0.5,0]) square([250,1],0);
color(C1) rotate(A2) translate([0,-0.5,0]) square([250,1],0);
color(C2) translate(SECRET_CALCULATION) circle(R);
}
//EXPLANATIONS
color(C0) translate(P) {
translate(SECRET_CALCULATION){
translate([0,-0.2,0]) square([R,0.4],0);
translate([R+1,0,0]) rotate(-90) text(str("R:",R),halign="center",valign="top",0.75);
translate([0,0.2,0]) text("[x?,y?,0]",halign="center",valign="bottom",0.75);
}
rotate(((A1-A2)/2)-90) translate([0,-1,0]) text(str("P: ",P),halign="center",valign="top",0.75);
rotate(A1) text(str(" A1: ",A1,"°"),halign="left",valign="center",0.75);
rotate(A2) text(str(" A2: ",A2,"°"),halign="left",valign="center",0.75);
}
我欣賞的努力,但是使用這種計算,我得到'[5.254,5.296]'爲圓圈中心點......這是不正確的。值應該更接近'[8.2,4.3]'(這是基於視覺表示的估計):( –
[8.2,4.3]不是座標!它與點P不同!注意Cos(27.5)* 9.3 = 8.24 Sin(27.5)* 9.3 = 4.3' – MBo
對不起,你對! 我會接受你的回答...謝謝你! –