我想创建基于中心点(我已经有中心点)的时钟手坐标。这里是我到目前为止的代码:创建基于偏离中心点的时钟手坐标
我有我的VB.NET形式是什么:
http://i58.tinypic.com/3ehwl.png
Private Sub CreateClockPoints(ByVal centerPt As VISIPoint)
Dim vPtD As New VISIPoint
If rbn1.Checked Then
vPtD.Put(centerPt.X, centerPt.Y + Util.convertVal(1.5, 1, 2), centerPt.Z)
ElseIf rbn2.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn3.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn4.Checked Then
vPtD.Put(centerPt.X + Util.convertVal(1.5, 1, 2), centerPt.Y, centerPt.Z)
ElseIf rbn5.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn6.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn7.Checked Then
vPtD.Put(centerPt.X, centerPt.Y - Util.convertVal(1.5, 1, 2), centerPt.Z)
ElseIf rbn8.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn9.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn10.Checked Then
vPtD.Put(centerPt.X - Util.convertVal(1.5, 1, 2), centerPt.Y, centerPt.Z)
ElseIf rbn11.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
ElseIf rbn12.Checked Then
vPtD.Put(centerPt.X, centerPt.Y, centerPt.Z)
End If
End Sub
从中心到时钟点的距离必须是1.5。
正如你所看到的,我已经有1,4,7和10了。我不确定2,3,5,6,8,9,11和12的配方是什么。让我知道你是否需要任何额外的信息,谢谢。
你对三角函数有什么了解?如果你有角度,那么计算'X = length * sin(angle)+ centerPt.X; Y =长度* cos(角度)+ centerPt.Y;'在3D中明显更复杂一点(但想法相同):[维基救援](https://en.wikipedia.org/wiki/) Rotation_(数学)#Three_dimensions) – Carsten
@CarstenKönig非常感谢,这就是我一直在寻找的东西。不熟悉数学知道这从我的头顶,但正确的方向我都准备好了。再次感谢你,你应该让这个答案,所以你得到信用。 – Joe
没问题 - 其他答案是一样的 - 我得到了我需要的所有代表(没有更多的里程碑获得,而且我也永远不会成为J. Skeet) - 只需选择最好的答案(接受)并接受它即可 – Carsten