2015-12-21 13 views
-7

我試圖求解XY座標列爲???JAVA:如何計算2d空間中的點?

所有可用而不需要計算的變量。

三角形旋轉的空間點是靜態的,長度和寬度也是靜態的。但旋轉角度不同。

如何解決???座標?

rotating a triangle

+2

讓我google一下你:http://www.tutorialspoint.com/computer_graphics/2d_transformation.htm。哦,-1 btw – zubergu

+0

似乎是一個問題math.exchange,因爲這不是一個代碼問題,而是一個數學問題。 – Manu

+0

首先看到[this](https://en.wikipedia.org/wiki/Trigonometric_functions)然後[this](https://en.wikipedia.org/wiki/Rotation_(mathematics)) – Neijwiert

回答

0

我得到答覆我的問題在這裏: http://mathhelpforum.com/trigonometry/255742-help-calculating-point-2d-space-rotating-right-angle-triangle.html#post883005

後,我創建了一個簡單的Java函數來處理這一切對我來說曾經給予適當的變量。

child.rotationPointY = (Width * (MathHelper.sin(-parent.rotateAngleX))) + (Height * (MathHelper.cos(-parent.rotateAngleX))) + parent.rotationPointY; 
child.rotationPointZ = (Width * (MathHelper.cos(-parent.rotateAngleX))) - (Height * (MathHelper.sin(-parent.rotateAngleX))) + parent.rotationPointZ; 

謝謝大家

相關問題