- 积分
- 24557
- 明经币
- 个
- 注册时间
- 2004-3-17
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-10-29 15:21:00
|
显示全部楼层
Dim p1(2) As Double
Public Function calc_point1(ByVal whirl_cen As Variant, ByVal PtoP_angle As Double, _ ByVal whirl_a As Double, ByVal whirl_r As Double) As Variant
'whirl_cen 为圆弧圆心坐标,PtoP_angle 为一个方位角,whirl_a 为回旋线放大系数,
'whirl_r为回旋线上一点对应半径 Dim temp_pt(1) As Double, t As Double, Arc_xy(1) As Double
Arc_xy(0) = 10 Arc_xy(1) = 20
t = whirl_a ^ 2 / whirl_r ^ 2 / 2
temp_pt(0) = whirl_cen(0) + (Arc_xy(1) + whirl_r * Cos(t)) * Cos(PtoP_angle) temp_pt(1) = whirl_cen(1) + (Arc_xy(1) + whirl_r * Cos(t)) * Sin(PtoP_angle)
p1(0) = temp_pt(0) - (Arc_xy(0) - whirl_r * Sin(t)) * Sin(PtoP_angle) p1(1) = temp_pt(1) + (Arc_xy(0) - whirl_r * Sin(t)) * Cos(PtoP_angle) p1(2) = 0
'添加debug.print
ThisDrawing.ModelSpace.AddPoint p1
calc_point1 = p1
End Function
Sub tt() a = calc_point1(p1, 30, 1, 5) End Sub
|
|