椭圆旋转矩阵? [英] Elliptical rotation matrix?

查看:199
本文介绍了椭圆旋转矩阵?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++中,我们可以绕任意轴旋转一个点:

In C++ we can rotate a point about an arbitrary axis:


  void radRotateAxis( float a, float b, float c, float theta )
  {
    float newX = (
      x*( a*a*(1-cos(theta)) + cos(theta)   ) +
      y*( a*b*(1-cos(theta)) - c*sin(theta) ) +
      z*( a*c*(1-cos(theta)) + b*sin(theta) ) );

    float newY = (
      x*( a*b*(1-cos(theta)) + c*sin(theta) ) +
      y*( b*b*(1-cos(theta)) + cos(theta)   ) +
      z*( b*c*(1-cos(theta)) - a*sin(theta) )  );

    float newZ = (
      x*( a*c*(1-cos(theta)) - b*sin(theta) ) +
      y*( b*c*(1-cos(theta)) + a*sin(theta) ) +
      z*( c*c*(1-cos(theta)) + cos(theta)   )  );

    x = newX ;
    y = newY ;
    z = newZ ;
  }

但是当我们走路theta 0 - > 2PI这绕着绕你旋转的轴的单位圆点。

But as we walk theta 0 -> 2PI this takes the point around a "unit circle" around the axis you're rotating about

我们如何让它像theta 0 - > 2PI的结果是关于一个椭圆的宽度a,高度b?

How can we make it so as theta 0 -> 2PI the results are about an ellipse of width a, height b?

我不想在转换后将变换矩阵应用到点关于轴 - 我正在寻找的是一个椭圆的旋转矩阵,如果有人知道这样的事情!

I do not want to apply transformation matrices to the points after rotating them about the axis - what I'm looking for is an "elliptical" rotation matrix, if anyone knows of such a thing!

推荐答案

定义矩阵A以将目标椭圆缩放到合适的单位圆。

Define a matrix A to scale the target ellipse to a suitable unit circle.

然后,A,旋转矩阵和A的逆的组合是您的椭圆旋转矩阵。

Then the composition of A, the rotation matrix, and the inverse of A is your elliptical rotation matrix.

这篇关于椭圆旋转矩阵?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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