数学 - C中的Trig问题 [英] Math - Trig Problem in C

查看:189
本文介绍了数学 - C中的Trig问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨。


好​​吧基本上我正在使用C#XNA处理一些事情,我无法理解它,可能是一个我不知道的简单答案。


我有一个带有中心点的圆圈,坐标(0,0)。

半径可以是任何数量(我们确实知道它是什么)

我有一个(可以是任何地方 - 是可变的),我们确实知道坐标,但它们可以在圈子的任何地方。

我们知道学位(如下所示)


我想从移动一圈,并找到新点。我不确定这是多么清楚,所以我将绘制一个快速的图像。

现在在我的图像中,你看到我的问题,我需要新点的坐标。在图片(4)中,我已经显示了我认为可以使用标准Trig / pythagorus获得的角度和长度,但是它需要的绿色长度。使用绿色长度我也可以添加这些原点的坐标以获得新的点坐标。有任何想法吗?获得我需要的替代方法?


谢谢,Josh

解决方案

A 旋转矩阵就是您所需要的。


亲切的问候,

Jos



A 旋转矩阵就是您所需要的。


亲切的问候,


Jos



我最近才开始使用矩阵,所以我还是有点新鲜。你能开始做algorythm吗?

可以假设我们有变量:

oldX

oldY

AngleChange


无论如何我会更好地理解它,谢谢。


Josh


< blockquote class =post_quotes>
我最近才开始使用矩阵,所以我对它们仍然有点新意。你能开始做algorythm吗?

可以假设我们有变量:

oldX

oldY

AngleChange


无论如何我会更好地理解它,所以谢谢。


Josh



它只是一个矩阵乘法:

展开 | 选择 | Wrap | 行号


Hi.

Ok basicly I am working on something using C# XNA and I cant get my head around it, possibly a simple answer I dont know.

I have a circle with a center point, co-ordinates (0,0).
The Radius could be any amount (we do know what it is though)
I have a point (which can be anywhere - is variable), we do know the co-ordinates but they could be anywhere around the circle.
We know the degrees (read below)

I want to move around the circle from the point by an amount of degrees and find the new point. Im not sure how clear this is so I will draw up a quick image.

Now in my image here, you see my problem I need the co-ordinates of the new point. In picture(4) I have shown which angles and lengths I think I can get using standard Trig/pythagorus, however its the green lengths I need. With the green lengths I can just add these too the co-ordinates of the origonal point to get new point coords. any ideas? alternative ways to get what I need?

Thanks, Josh

解决方案

A rotation matrix is all you need.

kind regards,

Jos


A rotation matrix is all you need.

kind regards,

Jos

I have only recently started using matrices so im still a bit new with them. Would you be able to start of the algorythm?
can offcourse assume we have variables:
oldX
oldY
AngleChange

I will try better understand it anyway, so thanks.

Josh


I have only recently started using matrices so im still a bit new with them. Would you be able to start of the algorythm?
can offcourse assume we have variables:
oldX
oldY
AngleChange

I will try better understand it anyway, so thanks.

Josh

It''s just a matrix multiplication:

Expand|Select|Wrap|Line Numbers


这篇关于数学 - C中的Trig问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆