亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vector.cs

?? Introduction to 3d game engine design一書的源代碼!
?? CS
字號:
// created on 10/22/2002 at 11:39 AM
using System;

namespace VehicleDynamics
{
	public class  Vector
	{

		public    Vector() {x=0.0; y=0.0; z=0.0;}
		public    Vector ( Vector other ) {x=other.x; y=other.y; z=other.z;}
		public    Vector ( double new_x, double new_y, double new_z )
		{x=new_x; y=new_y; z=new_z;}
		~Vector () {}

		// Operator functions.
		public static bool operator <( Vector first, Vector second )  {return (first.x < second.x && first.y < second.y && first.z < second.z);}
		public static bool operator >( Vector first, Vector second )  {return (first.x > second.x && first.y > second.y && first.z > second.z);}
		public  static  bool operator ==(Vector first, Vector second )  {return first.x==second.x && first.y==second.y && first.z==second.z;}
		public  bool Equals( Vector second )  {return x==second.x && y==second.y && z==second.z;}
		public  static  bool operator !=(Vector first, Vector second )  {return first.x!=second.x || first.y!=second.y || first.z!=second.z;}

		public  static  Vector operator -(Vector first)  {return new Vector(-first.x, -first.y, -first.z);}
		public  static  Vector operator - (Vector first, Vector second)  {return new Vector(first.x - second.x, first.y - second.y, first.z - second.z);}
		public  static  Vector operator + (Vector first, Vector second)  {return new Vector(first.x + second.x, first.y + second.y, first.z + second.z);}
		public  static  Vector operator / (Vector first, float value)  {return new Vector(first.x/value, first.y/value, first.z/value);}
		public  static  Vector operator * (Vector first, float value)  {return new Vector(first.x*value, first.y*value, first.z*value);}
		public  static  double operator * (Vector first, Vector second)  {return (first.x*second.x + first.y*second.y + first.z*second.z);}
   
		// Accessor functions.
		public double X  { get {return x;} set { x = value; } }
		public double Y  { get {return y;} set { y = value; } }
		public double Z  { get {return z;} set { z = value; } }

		// Set functions.
		public    Vector Set (
			double new_x,
			double new_y,
			double new_z
			) {x= new_x; y= new_y; z= new_z; return this;}
		public    Vector SetX (
			double new_x
			) {x= new_x; return this;}
		public    Vector SetY (
			double new_y
			) {y= new_y; return this;}
		public    Vector SetZ (
			double new_z
			) {z= new_z; return this;}
		public    Vector SetToZero () {x= 0; y= 0; z= 0; return this;}

		// Limiting functions.
		public    Vector Limit (
			Vector value,
			Vector limit
			) 
		{
			return new Vector( Math.Min( limit.X, Math.Max( limit.X, value.X) ),
				   Math.Min( limit.Y, Math.Max( limit.Y, value.Y) ),
				   Math.Min( limit.Z, Math.Max( limit.Z, value.Z) ) );}

		public    Vector Limit (
			Vector limit
			) 
		{
			LimitX( limit.X );
			LimitY( limit.Y );
			LimitZ( limit.Z ); return this;}

		public    double LimitX (
			double min_value,
			double max_value
			)  {return Math.Min( max_value, Math.Max( min_value, x) );}
		public    double LimitX (
			double value
			)  {return Math.Min( value, Math.Max( -value, x) );}
		public    double LimitY (
			double min_value,
			double max_value
			)  {return Math.Min( max_value, Math.Max( min_value, y) );}
		public    double LimitY (
			double value
			)  {return Math.Min( value, Math.Max( -value, y) );}
		public    double LimitZ (
			double min_value,
			double max_value
			)  {return Math.Min( max_value, Math.Max( min_value, z) );}
		public    double LimitZ (
			double value
			)  {return Math.Min( value, Math.Max( -value, z) );}

		public    Vector Delta (
			Vector from
			)  {return new Vector(x - from.x, y - from.y, z - from.z);}
		public    double DeltaX (
			Vector from
			)  {return x - from.x;}
		public    double DeltaY (
			Vector from
			)  {return y - from.y;}
		public    double DeltaZ (
			Vector from
			)  {return z - from.z;}
		public    Vector ABSDelta (
			Vector from
			)  {return new Vector(Math.Abs(x - from.x), Math.Abs(y - from.y), Math.Abs(z - from.z));}
		public    double ABSDeltaX (
			Vector from
			)  {return Math.Abs(x - from.x);}
		public    double ABSDeltaY (
			Vector from
			)  {return Math.Abs(y - from.y);}
		public    double ABSDeltaZ (
			Vector from
			)  {return Math.Abs(z - from.z);}
		/*
		public    float XYDotProduct (
				 Vector other
				)  { return new Vector( *this ).SetZ( 0. ).DotProduct( Vector( other ).SetZ( 0. ) ); }

		public    float XZDotProduct (
				 Vector other
				)  { return new Vector( *this ).SetY( 0. ).DotProduct( Vector( other ).SetY( 0. ) ); }
		public    float YZDotProduct (
				 Vector other
				)  { return new Vector( *this ).SetX( 0. ).DotProduct( Vector( other ).SetX( 0. ) ); }
		*/

		protected double x;
		protected double y;
		protected double z;


		private double DistanceFrom ( Vector from ) 
		{
			return Math.Sqrt((x-from.x)*(x-from.x) + (y-from.y)*(y-from.y) + (z-from.z)*(z-from.z));

		} // end otherDistanceFrom


		///////////////////////////////////////////////////////////////////////////////
		public double otherXYDistanceFrom (
			Vector from
			) 

		{
			return Math.Sqrt((x-from.x)*(x-from.x) + (y-from.y)*(y-from.y));

		} // end otherXYDistanceFrom



		///////////////////////////////////////////////////////////////////////////////
		public double otherDistanceFrom () 
		{
			return Math.Sqrt( (x*x) + (y*y) + (z*z) );

		} // end otherDistanceFrom

		///////////////////////////////////////////////////////////////////////////////
		public double DistanceFrom ( )
		{
			return Math.Sqrt( (x*x) + (y*y) + (z*z) );

		} // end DistanceFrom


		///////////////////////////////////////////////////////////////////////////////
		public double XYDistanceFrom ( Vector from )
		{
			return Math.Sqrt((x-from.x)*(x-from.x) + (y-from.y)*(y-from.y));

		} // end XYDistanceFrom

		///////////////////////////////////////////////////////////////////////////////
		public double XYDistanceFrom ()
		{
			return Math.Sqrt( (x*x) + (y*y) );

		} // end XYDistanceFrom

		///////////////////////////////////////////////////////////////////////////////
		public double otherXYDistanceFrom () 
		{
			return Math.Sqrt( (x*x) + (y*y) );

		} // end otherXYDistanceFrom

		///////////////////////////////////////////////////////////////////////////////
		public Vector Normalize () 
		{
			float temp = (float)Math.Sqrt(x*x + y*y + z*z);
			if ( temp != 0.0f )
				return new Vector( x/temp, y/temp, z/temp );

			return new Vector (0.0f, 0.0f, 0.0f );

		} // end otherUnitNormal

		///////////////////////////////////////////////////////////////////////////////
		public double otherDotProduct ( Vector other ) 
		{
			double cosine_theta = 0.0;
			if ( !( other.x == 0.0 && other.y == 0.0 && other.z == 0.0 ) &&
				!( x == 0.0 && y == 0.0 && z == 0.0 ) ) 
			{
				double dist1= other.DistanceFrom();
				double dist2= DistanceFrom();
				cosine_theta= x*other.x + y*other.y + z*other.z / ( dist1 * dist2 );
			}

			return cosine_theta;

		} // end otherDotProduct


		///////////////////////////////////////////////////////////////////////////////
		Vector CrossProduct ( Vector that)
		{
			return new Vector(y*that.z - z*that.y, z*that.x - x*that.z, x*that.y - y*that.x);

		} // end CrossProduct

		///////////////////////////////////////////////////////////////////////////////
		public Vector otherCrossProduct (  Vector other ) 
		{
			return new Vector(y*other.z - z*other.y, z*other.x - x*other.z, x*other.y - y*other.x);

		} // end otherCrossProduct





		///////////////////////////////////////////////////////////////////////////////
		public double otherSinThetaCrossProduct (
			Vector other,
			Vector product
			) 
		{
			double sine_theta = 0.0;
			if ( !( other.x == 0.0 && other.y == 0.0 && other.z == 0.0 ) &&
				!( x == 0.0 && y == 0.0 && z == 0.0 ) ) 
			{
				double dist1= other.DistanceFrom();
				double dist2= DistanceFrom();
				product= other.CrossProduct(this);
				sine_theta= ( product.X - product.Y + product.Z ) / ( dist1 * dist2 ) ;
			}

			return sine_theta;

		} // end otherSinThetaCrossProduct





		///////////////////////////////////////////////////////////////////////////////
		public double otherElevBrg (
			Vector other
			) 

		{
			double xy_length= XYDistanceFrom( other );
			double elev_brg= Math.Atan2( DeltaZ( other ), xy_length );

			while ( elev_brg > Math.PI ) elev_brg -= Math.PI;
			while ( elev_brg < -Math.PI ) elev_brg += Math.PI;

			return elev_brg;

		} // end otherElevBrg





		///////////////////////////////////////////////////////////////////////////////
		public double otherRelBrg (
			Vector other
			) 

		{
			return Math.Atan2( Y-other.Y, X-other.X );

		} // end otherRelBrg


		///////////////////////////////////////////////////////////////////////////////
		bool otherIsParallelWith (
			Vector other
			) 

		{
			return CrossProduct(other) == new Vector(0.0f, 0.0f, 0.0f);

		} // end otherIsParallelWith





		///////////////////////////////////////////////////////////////////////////////
		/*
		 float otherDistanceFromLine (
			 Vector point0,
			 Vector point1
			) 

		{
			float distance= point0.DistanceFrom(point1);
			return (distance > 0.001)? ((point0 - point1).CrossProduct(this - point1).DistanceFrom() / distance) : DistanceFrom(point0);

		} // end otherDistanceFromLine
		*/

		public void IncrementX(double value)
		{
			x += value;
		}

		public void IncrementY(double value)
		{
			y += value;
		}

		public void IncrementZ(double value)
		{
			z += value;
		}

	};
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品aa午夜观看| 香蕉加勒比综合久久 | 色8久久人人97超碰香蕉987| 一区二区三区精品在线观看| 欧美乱妇15p| 国产麻豆91精品| 亚洲最大成人网4388xx| 一区二区视频免费在线观看| 亚洲柠檬福利资源导航| 久久欧美一区二区| 欧美色男人天堂| av在线一区二区三区| 美腿丝袜亚洲色图| 亚洲免费观看在线观看| 亚洲一级片在线观看| 国产亚洲一区二区在线观看| 欧美激情综合五月色丁香| 4438成人网| 欧美三级欧美一级| 日韩免费观看高清完整版| 欧美日韩美少妇| 色乱码一区二区三区88| 在线不卡一区二区| 久久久国产午夜精品| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 欧美日韩视频在线一区二区| 日韩欧美美女一区二区三区| 欧美国产激情二区三区| 亚洲成a人片在线不卡一二三区| 青娱乐精品视频在线| 午夜欧美大尺度福利影院在线看| 国产精品麻豆视频| 天天综合网天天综合色| 国产成人免费网站| 成人av资源网站| 不卡大黄网站免费看| 884aa四虎影成人精品一区| 国产亚洲成年网址在线观看| 亚洲一二三四在线观看| 国产电影一区在线| 欧洲亚洲精品在线| 欧美巨大另类极品videosbest | 91精品国产一区二区三区香蕉| 色爱区综合激月婷婷| 欧美大片拔萝卜| 一区二区三区欧美日| 高潮精品一区videoshd| a亚洲天堂av| 日韩精品一区二区在线观看| 亚洲日穴在线视频| 亚洲va中文字幕| eeuss鲁片一区二区三区在线看| 欧美电影免费观看高清完整版在线 | 精品国产99国产精品| 26uuu久久综合| 国产日韩高清在线| 亚洲精品免费在线播放| 日日摸夜夜添夜夜添亚洲女人| 六月丁香综合在线视频| 国产mv日韩mv欧美| 欧美成人精品1314www| 国产精品美女久久久久久久久久久| 日本视频中文字幕一区二区三区| 黄色精品一二区| 91香蕉视频mp4| 日韩一级高清毛片| 国产精品白丝在线| 免费av网站大全久久| 在线区一区二视频| 亚洲综合色区另类av| 99久久精品国产导航| 日韩精品中文字幕在线不卡尤物| 亚洲国产中文字幕在线视频综合 | 日本特黄久久久高潮| 欧美日韩国产三级| 午夜精品久久久久久久蜜桃app| 在线视频亚洲一区| 亚洲高清视频在线| 911精品国产一区二区在线| 日欧美一区二区| 日韩精品中文字幕一区| 国产一区在线观看视频| 久久久不卡网国产精品一区| 极品少妇xxxx偷拍精品少妇| 欧洲激情一区二区| 亚洲aⅴ怡春院| 日韩一二三区不卡| 国产精品白丝jk白祙喷水网站| 欧美欧美欧美欧美| 日韩成人精品视频| 久久众筹精品私拍模特| 东方欧美亚洲色图在线| 国产精品久久久久永久免费观看| 99re热视频精品| 丝袜亚洲另类欧美| 精品久久久久久亚洲综合网 | 国产精品一区二区无线| 中文字幕在线观看一区二区| 国产精品一区久久久久| 国产色一区二区| 色婷婷亚洲精品| 日韩在线一二三区| 久久综合999| 色综合久久六月婷婷中文字幕| 亚洲国产精品影院| 精品国产乱码久久久久久1区2区| 成人午夜精品在线| 欧美经典一区二区三区| 欧美制服丝袜第一页| 久久爱www久久做| 亚洲婷婷在线视频| 日韩精品专区在线影院观看| 波多野结衣中文字幕一区| 日韩精品1区2区3区| 国产精品三级久久久久三级| 欧美精品色一区二区三区| 国产精品99久久久久久似苏梦涵| 一区二区三区四区国产精品| 久久影院午夜片一区| 欧美日韩一区二区在线观看| 粉嫩一区二区三区在线看| 日本特黄久久久高潮| 亚洲综合一二三区| 日本一区二区久久| 精品国产伦一区二区三区免费| 欧美在线一二三| av电影在线不卡| 国产福利视频一区二区三区| 91在线看国产| 国内成+人亚洲+欧美+综合在线| 亚洲一区国产视频| 亚洲视频一区二区免费在线观看| 久久综合一区二区| 欧美高清精品3d| 日本高清不卡aⅴ免费网站| 国产盗摄视频一区二区三区| 日韩不卡一区二区| 午夜免费久久看| 亚洲国产色一区| 亚洲国产一区在线观看| 亚洲五月六月丁香激情| 一区二区三区在线观看网站| 亚洲视频1区2区| 自拍偷拍欧美精品| 国产精品美女久久久久久| 国产片一区二区| 国产精品区一区二区三| 久久―日本道色综合久久| 久久嫩草精品久久久精品一| xnxx国产精品| 国产欧美日本一区二区三区| 久久久影视传媒| 2022国产精品视频| 亚洲国产精品ⅴa在线观看| 久久婷婷国产综合精品青草| 久久女同互慰一区二区三区| 日韩免费高清av| 日韩久久久精品| 精品三级av在线| 久久蜜桃香蕉精品一区二区三区| 久久人人97超碰com| 欧美mv日韩mv| 日韩精品一区二区三区中文精品| 欧美一级一级性生活免费录像| 欧美日韩一级片在线观看| 粉嫩一区二区三区在线看| 亚洲午夜一二三区视频| 亚洲国产裸拍裸体视频在线观看乱了 | 精品国产精品一区二区夜夜嗨| 日韩一级二级三级| 久久久精品人体av艺术| 国产蜜臀av在线一区二区三区| 国产精品成人一区二区艾草 | 欧美一区二区三区系列电影| 久久久五月婷婷| 日韩伦理av电影| 日韩高清在线不卡| 国产精品亚洲人在线观看| 91免费视频观看| 91精品国产福利| 国产精品久久久久久久浪潮网站| 亚洲综合激情小说| 韩国精品主播一区二区在线观看| 丁香婷婷综合色啪| 正在播放亚洲一区| 国产精品欧美久久久久一区二区| 亚洲电影在线播放| 国产麻豆日韩欧美久久| 欧美主播一区二区三区美女| 欧美精品一区二区三区在线播放| 17c精品麻豆一区二区免费| 日韩电影免费在线观看网站| 成人精品视频网站| 在线播放中文字幕一区| 国产精品久久久久四虎| 久久综合综合久久综合| 欧美中文字幕一区| 国产精品人妖ts系列视频| 麻豆精品视频在线| 成人污污视频在线观看|