Package com.sun.j3d.utils.geometry

Source Code of com.sun.j3d.utils.geometry.Basic

/*     */ package com.sun.j3d.utils.geometry;
/*     */
/*     */ import javax.vecmath.Tuple2f;
/*     */ import javax.vecmath.Tuple3f;
/*     */
/*     */ class Basic
/*     */ {
/*     */   static final double D_RND_MAX = 2147483647.0D;
/*     */
/*     */   static double detExp(double u_x, double u_y, double u_z, double v_x, double v_y, double v_z, double w_x, double w_y, double w_z)
/*     */   {
/*  29 */     return u_x * (v_y * w_z - v_z * w_y) - u_y * (v_x * w_z - v_z * w_x) + u_z * (v_x * w_y - v_y * w_x);
/*     */   }
/*     */
/*     */   static double det3D(Tuple3f u, Tuple3f v, Tuple3f w)
/*     */   {
/*  37 */     return u.x * (v.y * w.z - v.z * w.y) - u.y * (v.x * w.z - v.z * w.x) + u.z * (v.x * w.y - v.y * w.x);
/*     */   }
/*     */
/*     */   static double det2D(Tuple2f u, Tuple2f v, Tuple2f w)
/*     */   {
/*  45 */     return (u.x - v.x) * (v.y - w.y) + (v.y - u.y) * (v.x - w.x);
/*     */   }
/*     */
/*     */   static double length2(Tuple3f u)
/*     */   {
/*  51 */     return u.x * u.x + u.y * u.y + u.z * u.z;
/*     */   }
/*     */
/*     */   static double lengthL1(Tuple3f u)
/*     */   {
/*  56 */     return Math.abs(u.x) + Math.abs(u.y) + Math.abs(u.z);
/*     */   }
/*     */
/*     */   static double lengthL2(Tuple3f u)
/*     */   {
/*  61 */     return Math.sqrt(u.x * u.x + u.y * u.y + u.z * u.z);
/*     */   }
/*     */
/*     */   static double dotProduct(Tuple3f u, Tuple3f v)
/*     */   {
/*  67 */     return u.x * v.x + u.y * v.y + u.z * v.z;
/*     */   }
/*     */
/*     */   static double dotProduct2D(Tuple2f u, Tuple2f v)
/*     */   {
/*  73 */     return u.x * v.x + u.y * v.y;
/*     */   }
/*     */
/*     */   static void vectorProduct(Tuple3f p, Tuple3f q, Tuple3f r)
/*     */   {
/*  79 */     r.x = (p.y * q.z - q.y * p.z);
/*  80 */     r.y = (q.x * p.z - p.x * q.z);
/*  81 */     r.z = (p.x * q.y - q.x * p.y);
/*     */   }
/*     */
/*     */   static void vectorAdd(Tuple3f p, Tuple3f q, Tuple3f r)
/*     */   {
/*  87 */     p.x += q.x;
/*  88 */     p.y += q.y;
/*  89 */     p.z += q.z;
/*     */   }
/*     */
/*     */   static void vectorSub(Tuple3f p, Tuple3f q, Tuple3f r)
/*     */   {
/*  94 */     p.x -= q.x;
/*  95 */     p.y -= q.y;
/*  96 */     p.z -= q.z;
/*     */   }
/*     */
/*     */   static void vectorAdd2D(Tuple2f p, Tuple2f q, Tuple2f r)
/*     */   {
/* 102 */     p.x += q.x;
/* 103 */     p.y += q.y;
/*     */   }
/*     */
/*     */   static void vectorSub2D(Tuple2f p, Tuple2f q, Tuple2f r)
/*     */   {
/* 109 */     p.x -= q.x;
/* 110 */     p.y -= q.y;
/*     */   }
/*     */
/*     */   static void invertVector(Tuple3f p)
/*     */   {
/* 115 */     p.x = (-p.x);
/* 116 */     p.y = (-p.y);
/* 117 */     p.z = (-p.z);
/*     */   }
/*     */
/*     */   static void divScalar(double scalar, Tuple3f u)
/*     */   {
/*     */     Tuple3f tmp1_0 = u; tmp1_0.x = ((float)(tmp1_0.x / scalar));
/*     */     Tuple3f tmp13_12 = tmp1_0; tmp13_12.y = ((float)(tmp13_12.y / scalar));
/*     */     Tuple3f tmp25_24 = tmp1_0; tmp25_24.z = ((float)(tmp25_24.z / scalar));
/*     */   }
/*     */
/*     */   static void multScalar2D(double scalar, Tuple2f u)
/*     */   {
/*     */     Tuple2f tmp1_0 = u; tmp1_0.x = ((float)(tmp1_0.x * scalar));
/*     */     Tuple2f tmp13_12 = tmp1_0; tmp13_12.y = ((float)(tmp13_12.y * scalar));
/*     */   }
/*     */
/*     */   static int signEps(double x, double eps)
/*     */   {
/* 136 */     return x <= eps ? 0 : x < -eps ? -1 : 1;
/*     */   }
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\j3dutils.jar
* Qualified Name:     com.sun.j3d.utils.geometry.Basic
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of com.sun.j3d.utils.geometry.Basic

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.