⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 quaternion.java

📁 基于java的3d开发库。对坐java3d的朋友有很大的帮助。
💻 JAVA
字号:
//===========================================================================//=-------------------------------------------------------------------------=//= Module history:                                                         =//= - August 8 2005 - Oscar Chavarro: Original base version                 =//===========================================================================package vsdk.toolkit.common;public class Quaternion extends FundamentalEntity{    /// Check the general attribute description in superclass Entity.    public static final long serialVersionUID = 20060502L;    public Vector3D direction;    public double magnitude;    public Quaternion()    {        direction = new Vector3D(0, 0, 0);        magnitude = 0;    }    public double length()    {        return magnitude * magnitude + direction.dotProduct(direction);    }    public void normalize()    {        double l;        l = length();        magnitude *= 1/l;        direction = direction.multiply(1/l);    }    public String toString()    {        String msg;        msg = direction + " / " + VSDK.formatDouble(magnitude);        return msg;    }}//===========================================================================//= EOF                                                                     =//===========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -