两个向量的点乘和叉乘叉乘为何得到的是他们的法向量的点乘和叉乘 高等数学

An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click
to find out more about this error.为什么两个向量的叉乘会是一个向量?【高等数学吧】_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:249,455贴子:
为什么两个向量的叉乘会是一个向量?收藏
数学在线教学一对一 针对学科薄弱点 个个突破 量身制定辅导课程足不出户免费辅导 精细化课程设置 满足不同学生的学习需求 学费全免网数学就是好
既然点乘的意义是投影乘上模,那叉乘的意义是什么?
憋和我说多读书,太敷衍,起码说下看啥书
大学物理,刚体那一章有讲。
给别人擦屁股的事还真心难做做的我鬼冒火
登录百度帐号推荐应用叉积方向确定和两个点组成的向量方向
叉积能得到两个向量组成的面的法线;
点积能得到两个向量之间的弧度;如果其中一个是归一化的向量,那么点积就是另外一个向量在这个向量上的投影。
----------------------
叉积是发生在两个向量之间的运算,因为叉积并无位置(只有大小和方向),所以我们总可以把这两个向量通过移动来得到一个由它们决定的平面(试想如果向量有位置,那么这个就没有一定之说,因为两个“有位置的”向量可能在空间中不接触交叉,而根本没有哪个面可以同时容纳它们两个)。对很多时候的几何计算来看,这个面的法向量是很有用的,这个法向量可以通过这两个向量的叉乘来得到。但是,既然是平面的法向量,如果不定义规则,则可能有两个方向,一般我们用右手规则来统一这个问题,即:起右手,从第一个向量(的方向),四指绕向第一个向量(不需要方向同),则大拇指方向就是法向量的法向。
----------------------
虽然说向量无位置,但是一般我们在实际运用中,都会有两个点来得到从一点到另外一点的向量,在代数上,用的是减法。从点A到点B的向量(图形中,箭头指向B),代数是
---------------------
向量的归一化用到的地方
1、求两个向量之间的夹角,两个向量都需要归一化,这样点积就是弧度;
(A dot B = mod(A) * mod(B) *
cosQ,左边的A和B是用户界面上可以得到的三个点(x,y,z),右边的两个mod值都是1,所以cosQ就有结果了。)
2、求A向量在B向量上的投影长度,则B向量需要归一化,这样点积就是A在B方向上的投影长度;
(A dot B = mod(A) * mod(B) *
cosQ,左边的A和B是用户界面上可以得到的三个点(x,y,z),右边的两个mod值第一个是A的长度,第二个是1。这里我们不关心cosQ,却关心右边算式的几何意义。)
参考资料:
Vector Math is easily one of the most used forms of math in 3D game
programming. Here are some examples of the basics of vector math,
and some of its uses in games. In the following examples we'll be
referring to three dimensional vectors. They're represented by
three numbers, each one corresponding to a dimension. E.g. (-2, -3,
16) can represent a point that lies at -2 in the x coordinate, -3
in the y coordinate, and 16 in the z coordinate. Vectors can also
represent distances, force, velocity, and other fun stuff.
Vector subtraction
Vector subtraction is as easy as simple arithmatic. You simply
subtract each component of one vector from the other.
Vector a = (3, -5, 7)
Vector b = (5, -2, -9)
Vector c = (3 - 5, -5 - -2, 7 - -9) = ( -2, -3, 16)
So, what does vector subtraction get us? A couple of useful things.
It gives us the direction from one vector to another. In this
example, 'c' is a vector that points from the point represented by
vector 'b' to vector 'a'. Using vector 'c' we can determine a
direction and distance from b to a, which we shall show in the next
two examples.
=&new&Vector3(3, -5, 7);
=&new&Vector3(5, -2, -9);
// There are a few ways we
can do this, XNA has many Vector math functions built
Vector3&c = a -
=&new&Vector3();
Vector3.Subtract(a,
This places the result of a - b into c.
=&new&Vector3(a.x -
b.x, a.y - b.y, a.z - b.z);
If you were to draw vectors 'a' and 'b' from (0, 0, 0) to their
respective points, then vector 'c', would connect the end points of
each of those vectors.
Distance between two points
Given two points, we can easily determine a distance between them.
Subtracting Vectors 'a' and 'b' in the previous example we were
able to determine that Vector 'c' = (-2, -3, 16). Vector 'c'
represents a line between points 'a' and 'b', so if we can
determine the distance of the line, then we're done. The formula
for this is:
d = √(x^2 + y^2 + z^2)
given our example we have:
d = √(4 + 9 + 256) = √269 = 16.4012
So the length of vector c, and the distance from 'a' to 'b' is
16.4012 units. You'll notice that we have 269 before we do the
square root operation. This number is referred to as the 'squared
length' or 'length squared'. As we'll see later, this number can be
useful as well.
=&new&Vector3(3, -5, 7);
=&new&Vector3(5, -2, -9);
Vector3&c = a -
// XNA has a distance/length
float&distance =
c.Length();
// Or we can do it ourself,
by taking the square root of the squared
lengthfloat&distance
=&Math.Sqrt( c.x * c.x + c.y * c.y
+ c.z * c.z );
Unit length direction from one point to another
Given two points, we can easily determine direction from one to the
other. Continue with our original example, we subtracted vector 'b'
from vector 'a', which gives us the direction and length together.
In vector math it is often useful to have a unit-length vector (a
vector with a length of 1), so we'll take Vector 'c' and make it
unit-length, which will leave us with a vector that represents
direction.
Once you've determined the length of the vector, you simply divide
the original vector by it's length. In the previous example
'Distance between two vectors' we determined the length, which was
~16.4012. So we'll just divide vector 'c' by that amount.
-2 / 16.4012, -3 / 16.4012, 16 / 16.4012 = ( -0.1219, -0.1829,
This gives us the direction from point 'b' to point 'a'. Unit
length vectors are useful for many purposes, such as being used to
find the angle between two unit-length vectors, or if you wanted to
move an AI unit in a specific direction and speed, you could use a
unit-vector and then scale it by the desired speed.
=&new&Vector3(3, -5, 7);
=&new&Vector3(5, -2, -9);
Vector3&c = a -
// XNA has a function to
create a unit-length vector for us.c = c.Normalize();
&&// After this line executes, 'c' will be
unit-length&
// Or we can do this ourself.
If we've already calculated length, this is even more
// if you've already calculated distance for something
float&distance
=&Math.Sqrt( c.x * c.x + c.y * c.y
+ c.z * c.z );
You'll notice above that we calculate distance so that we can
normalize/unitize our vector. If you call the Normalize() function
that comes with XNA it does this all for you. That is convienent,
but if you've already calculated length for another use, and then
need to normalize a vector, then it is more efficient to simply
normalize it on your own. In fact, in my own programming I've come
along the cases like this, or cases where I would need the length
of a vector right before I normalized it, so I created a function
that normalizes a vector, and returns the length before
normalization.
public&float&Normalize(Vector3&vector)
&&&&float&lengthSqr
= ((vector.X * vector.X) + (vector.Y * vector.Y)) + (vector.Z *
vector.Z);
&&&&float&length
= (float)Math.Sqrt((float)lengthSqr);
&&&&float&num
&&&&vector.X
&&&&vector.Y
&&&&vector.Z
&&&&return&
You may notice that all multiplication is done on each component
individually. For example, instead of vector *= num, I did each
component individually. This is because the overloaded operator for
multiplying vectors by a scalar value is slower than multiplying
each float value of a vector3 by another float. Also, by
calculating 'num' we can multiply by that three times rather than
doing the division by length three times. This part isn't so much a
lesson in vector math, more a lesson in efficiency with XNA, and an
explanation why this function has slightly more code than you might
Using squared lengths
As we mentioned in one of the previous examples: 'Distance Between
Two Points', squared lengths can be useful. Most of the time when
you're calculating a squared length it is almost immediately square
rooted to give length, but occasionally this isn't needed. For
example, when you want to compare two lengths to see which is
If you want to compare two lengths to see which is greater, you
could find the exact length of each, and compare them, but the fact
is that you really may not care what the exact lengths of each
vector is, you just want to know which vector has the greatest
length. In this case, you can just use a squared length.
This is same method as we described earlier, but without the square
d^2 = (x^2 + y^2 + z^2)
So lets see how we could put a length comparison of two vectors
into a simple function.
public&bool&FirstVectorLongest(Vector3&vectorA,&Vector3&vectorB)
&&&&float&lengthSqrA
= ((vectorA.X * vectorA.X) + (vectorA.Y * vectorA.Y)) + (vectorA.Z
* vectorA.Z);
&&&&float&lengthSqrB
= ((vectorB.X * vectorB.X) + (vectorB.Y * vectorB.Y)) + (vectorB.Z
* vectorB.Z);
&&&&return&lengthSqrA
& lengthSqrB;
Comparing the length of two vectors can represent more than just
distance between two points. Because vectors can also represent
velocities, this function is also useful for determining which
vector represents a higher velocity.
Dot Product
Dot product is one of the properties of vectors that you can get
when multiplying them. The dot product has many useful properties
with vectors, in fact, the Dot Product and Cross Product are
probably the two most important properties of vectors in 3D math
used in video games. A dot product requires multiplying each
component of two vectors and adding them together, as such:
Vector a = (3, -5, 7)
Vector b = (5, -2, -9)
a (dot) b = (3 * 5 + -5 * -2 + 7 * -9) = 15 + 10 - 63 = -38
You'll notice that we end up with a real number value when using
the dot product. This number can be more useful when used with two
vectors of unit-length, as we'll see in an upcoming example. The
dot product is also useful in vector projection,
vector&-&plane math, and more.
Angle between two vectors/lines
In 3D games you'll often find cases where you may want to know the
angle between two vectors. For example, you may want to know how
many degrees an AI unit will need to turn to face its target. You
may want to know how far a camera needs to rotate to face the same
direction as the player it is attached to. So how do we determine
the angle between two lines? Using the Dot Product and a little bit
of triginometry.
Vector a = (1, 0, 0)&
Vector b = (0, 1, 0)
a (dot) b = (1 * 0 + 0 * 1 + 0 * 0) = 0
arccos(0) = 1.5708
So what we did was find the dot product between two vectors, a and
b, which resulted in zero. We then find the arc cosine of zero,
which is 1.5708, or half of Pi, which is 90 degrees.
public&bool&AngleBetweenTwoVectors(Vector3&vectorA,&Vector3&vectorB)
&&&&float&dotProduct
Vector3.Dot(vectorA, vectorB, dotProduct);&
&&&&return&dotP&
It can also be useful to not only know the angle between two
vectors, but also if the signed angle should be negative or
positive. This can tell us things like which direction to turn, not
just how far. Here is a function to do just that for us.
public&double&GetSignedAngleBetweenTwoVectors
(&Vector3&Source,&Vector3&Dest,&Vector3&DestsRight
We make sure all of our vectors are unit
Source.Normalize();&
&&&&Dest.Normalize();
&&&&DestsRight.Normalize();
&&&&float&forwardDot
= Vector3.Dot( Source, Dest );
&&&&float&rightDot
= Vector3.Dot( Source, DestsRight );
Make sure we stay in range no matter what, so Acos doesn't fail
&&&&forwardDot
= MathHelper.Clamp( forwardDot, - 1.0f, 1.0f
&&&&double&angleBetween
=&Math.Acos( (float) forwardDot
( rightDot & 0.0f )&
&&&&&&&&angleBetween
*= - 1.0f;&
&&&&return&angleB&
We do our initial dot product to find the angle between the two
vectors, this is what we store in 'forwardDot'. We then do another
dot product, between the source vector and a vector that is
perpedicular to the dest vector and also on the same plane to the
dest vector. (We'll learn how to do this soon when we learn about
Cross Products). The dot product we get from this is 'rightDot'. If
rightDot is less than zero then we know that the dest vector is to
the right (or clockwise) from the source vector (on a unit circle),
otherwise, dest vector is to the left. This is why we can multiply
the angle by negative one if it is to the right, this lets us
determine which direction the angle is in.
In this first example, we can see that the 'dest' vector is to the
right (counterclockwise) of the source vector:
Because the angle between S and R (dest's right vector) is greater
than 90 degrees, the dot product will be negative. The negative dot
product is our indication that the 'dest' vector is in fact to the
relative right (clockwise) to the source vector. In the next
example we can see that 'dest' is to the relative left
(counterclockwise) or the source vector:
In this example the dot product between S and R will give us a
positive number because it the angle between them is less than 90
degrees. This proves that D (dest vector) is to the relative left
of the source vector.
Knowing whether the 'dest' vector is clockwise or counterclockwise
on the same plane that S and D lie on tells use which direction to
turn, which is useful especially for AI movements.
Vector Projection
Vector projection means that you're taking a vector, and projecting
it onto another vector.
It is important to note that the length (magnitude) of a vector is
often represented like so: | b |
The formula for projecting a vector (vector A) onto another vector
(vector B) is:
projB (A) = ( (a (dot) b) / |b|^2 ) * b
Lets see an example:
Vector a = (2, 2, 0)
Vector b = (1, 0, 0)
a (dot) b = 2 * 1 + 2 * 0 + 0 * 0 = 2
( 2 / 1 ) * b = (2, 0, 0)
Vector A' is the result of the vector projection of vector 'A' onto
vector 'B'. The best way to think about this is that vector A' is
in the same direction as vector 'B', and any part of the original
'A' that wasn't in this direction is discarded. So if you look at
vector B, it is in the +X direction only, represented by 1, 0, 0.
If you took vector 'A' and took out anything not in the +X
direction, then you you be left with (2, 0, 0), and that is what we
get with the vector projection. It is easy to look at this visually
in this example because vector 'B' runs exactly along one of the
three major axes. But in most cases it isn't as easy to visualize,
and that is why the formula helps.&
Here is how we'd do it in XNA:
public&Vector3&ProjectVector(&Vector3&Source,&Vector3&Target,&Vector3&DestsRight
&&&&float&dotProduct
&&&&Vector3.Dot(Source,
Target, dotProduct);
&&&&Vector3&projectedVector
= (dotProduct / Target.LengthSquared()) * T
&&&&return&projectedV
Cross Product (under construction)
Cross product is another product of multiplication of vectors.
<font COLOR="#、
下面就几个名称进行一下阐释:
视点、观察点、camera、相机位置:具体指人的眼睛所在的位置;
normal:平面法线;
DotProduct、CrossProduct:点积与叉积的运算函数,在本文中没有给出;
多边形Polygon、平面Plant:多边形是平面的一部分,可能是三角形、四边形、六边形等;平面是无限的面;
Edge、Point、Line、Tray:分别表示边、(顶)点、直线、射线;啰嗦!
只要你懂得一点向量的运算就可以了
点积计算在碰撞检测中的应用&
点积的一个令人兴奋的事情就是一个是单位向量而另一个不是单位向量的运算结果,正如刚才我们讨论的,两个单位向量的点击是两个向量的夹角的余弦值.如果其中一个不是单位向量,那么点击结果就是夹角余弦值与非单位向量长度的乘积.如图c
正如你所看到的,非单位向量v1构成了三角形的斜边,v2是单位向量(实线部分),构成三角形的直角边.现在可以看出,余弦值就是两个向量的点积结果除以v1的长度.
换句话说,他们的点积就是v1在v2方向的投影(0.0~p1)长度就是点积的结果.
现在开始想象,第三边是一个多边形的所在的平面并且坐标(5,5)就在平面之上(平面上的任意一点).
V1可以认为是视点(或称camera)到定点(5,5)的方向向量.接着想象,v2是多边形或平面的法线,(0,0)是观察者的观察点.那么点积的结果就是观察者到平面(多边形)p1的距离.哈哈,如果这个值很大的话,那么你离这个平面就很远喽@!
你是不是还是很迷惑?这怎么可能啊.下面我来看一下:在图c中,利用几何的知识可以看出,我的眼睛即视点(0,0)到平面的距离是5,这是很明显的.那么我们用点积计算将得到什么结果呢?我们来试一下:
VECTOR v1=(5. 0 , 5. 0 , 0. 0);
//三角形斜边,它表示的是从视点(眼睛)到平面上一点的方向向量
VECTOR v2=(1. 0 , 0. 0 , 0. 0
);&/单位矢量,多边形所在平面的法线&
float p1=DotProduct(v1,v2);&//
p1=视点到面的距离&
值是5.这就是计算到平距离所必须的.但为什么是对的呢?下面我们来看下:
v1的长度如下:
lenght = sqrt (5*5,0*0,5*5); //& 7. 0710678.
这就是v1的长度.从图c中我们可以很快计算得出两个矢量的夹角是45°.我们用如下点积公式进行检验:
5 / 7. . 7071067; //这就是角度的余弦值
float angle=acos(0. . 7853981; // 0.
这样,你可以看到结果是正确的.只不过是点积得到的是余弦值的矢量v1的长度倍.
DotProduct=cos_angle=0. 7071067(cosine of 45 degrees) * 7. 0710678
(length of v1) =5;&
线与面是否相交&
我们已经知道了怎样计算点到面的距离,那么怎样判定射线或直线是否与平面相交呢?我们希望能够得到从任意一点发射的射线与平面的交点的精确
go吧!在开始之前,我们需要知道:在3d空间里,我们需要3点来定义一个平面,我们用一个三角形的边来定义矢量,这两个矢量通过叉积运算来得到面(三角形所在平面)的法线normal.
如图:v1,v2,
v3构成一个平面,要得到法线normal就要先得到平面上的两个向量,三角形的边就是现成的向量(o,yeah).那么两个边的叉积的结果就是法线n.如下:
得到平面上的两个向量:
Vector edge1=v2-v1;//由v1指向v2
Vector edge3=v3-v1;
Vector Normal=CrossProduct(edge1,edge2);
现在我们就要开始验证一条直线或射线是否会与一个多边形所在的平面相交.
这个例子里,线段(起始点为视点或眼睛)开始于(-2,4),射向(相机的朝向,视觉方向)坐标(4,-8)图中绿色线.&
为了演示起见,我们已经利用上面讲到的叉积生产了多边形的法线n,平面如红色线表示与x轴成45°.他的法线可以表示为(-0. 707,0.
707,0. 0);
首先我们得到线的起点(视点linestart)到平面的距离如图中橙色L3所示.然后我们计算粉色L1向量.L1向量是由平面上的任意一点(称之为顶点vertex)减去视点得到的.下面用L1与法线n进行点积运算,得到的是两个向量的夹角余弦值的L1的长度倍(真别扭),得到的是点到平面的距离L3.实现代码非常简单,如下:
Find Distance to Plane&
VECTOR L1=vertex-
Distance_to_plane=DotProduct(L1,Normal); // =8. 4852 which is
correct so far according to figure d.&
现在,我们同样计算射线或直线的方向向量(即视线方向lineend-linestart)及其与平面法线的点积.得到的结果就是夹角余弦值的|lineend-linestart|倍及投影的长度(蓝色点),代码如下:
Calculate the Projected Line
VECTOR line_direction=(lineend-linestart); // gives us a vector of
float linelength=DotProduct(line_direction,Normal);//
linelength=-12. 72 which is correct. Trace the line down with you
finger on figure d.)
投影的长度告诉我们原始线在旋转和与法线布置时的特性.下面,我们要得到两段长度的比值.这样你就可以得到一个到达交点的百分比.其值在0~1之间,例如,0.5就是在linelenght*0.5长度处相交.就是在线的一半处就到达了交点处.如果结果(result)&1,那么线就没有到达平面.相反,如果值是负的,那么平面就在视线方向的反方向.代码如下:
float percentage = - Distance_to_Plane /
&// =0. 66667 or 66 percent of the way down the
line. Lets try that and see if its
intersect. x=linestart. x+line_direction. x*
// = - 2 + 6 * 0. 66667 = - 2 + 4= 2(X)&
intersect. y=linestart. y+line_direction. y*
// = 4 + - 12 * 0. 66667 = 4 + - 8 = -4(Y)&
intersect. z=linestart. z_line_direction. z*
// = 0 + 0 * 0. 66667 =0 (Z) not being used in this example
计算结果是&( 2 , -4 , 0
).&最后我们得到了线与面的交点.
那么下面我们写一下得到射线与平面的交点的函数:bool Get_Intersect
(VECTOR linestart,VECTOR lineend,VERTEX vertex,VECTOR normal,VECTOR
* intersection)//(起始点,终点,顶点,法线,返回的交点)
VECTOR direction,L1;
float linelength,dist_from_plane,
// calculate the lines direction vector (Green line in 图 d)
direction. x=lineend. x-linestart.
direction. y=lineend. y-linestart.
direction. z=lineend. z-linestart.
linelength=DotProduct(direction,normal);//计算点积
得到linestart到蓝色点的长度
// This gives us the line length (the blue dot L3 + L4 in figure
if (fabsf(linelength)&0. 00001)
//检测是否为0,浮点容差错误.
//平行于平面,没有交点,返回FALSE
L1. x=vertex. x-linestart. // 计算向量L1 calculate vector L1 (the
PINK line in figure d)
L1. y=vertex. y-linestart.
L1. z=vertex. z-linestart.
dist_from_plane=DotProduct(L1,normal); //得到点的面的距离
// gives the distance from the plane (ORANGE Line L3 in figure
percentage=dist_from_plane/ //计算百分率
// How far from Linestart , intersection is as a percentage of 0 to
if (percentage&0) // The plane is behind the start
of the line
//在反方向
if (percentage&1) // The line does not reach the
//线没有到达平面.
// add the percentage of the line to line start返回交点
intersection-&x=linestart. x+direction.
intersection-&y=linestart. y+direction.
intersection-&z=linestart. z+direction.
// ooh yes ^_^,产生碰撞了
这样,我们就可以对一条线和一个平面进行测试了.如果你不能马上理解就多读两遍上面的东西吧,当你理解了点积的一切你会感觉非常的不错的.结合图d,相信你最后会理解的.
但是怎样判定是撞在了多边形上还是平面(是无限的)上?&
well,well,我们取得的成果已经不小了\(^o^)/~.但还是有一个问题:我们得到了一个与平面相交的交点,并不意味着就得到了与多边形的交点,我们只要寻找能与多边形相碰撞的交点.事实上,交点(与多边形所在平面的交点)可能离多边形很远很远,所以,我们有必要对此进行判定.那么,怎样判断呢?
首先,我们创建从撞击点出发的终止于三个顶点的3个方向矢量,上图中,我们举例的是三角形,有三个点,我们创建了3个向量L1.L2.L3.(其他的如四边形、六边形等,你只要在多边形上取3个点即可)
现在法线化这些向量(得到向量的单位向量),使得向量都是单位向量.
下面,我们按顺序求两者的点积,例如DotProduct( L1 , L2 ) DotProduct( L2 , L3 )
DotProduct( L3 , L1
).每个点积的结果都是两个向量之间的夹角的余弦值,然后利用反余弦函数得到向量之间的夹角.
我们统计三个角度的和,如果值是360,那么点就在多边形上,并与多边形相撞,如图e所示的那样,三个角相加正好形成一个圆;相反,图f中的三个标了颜色的角相加&360°没有形成一个圆,那是因为碰撞点不在多边形上(碰撞点在三角形的外部).
前面,我们给出了一个与多边形所在平面的检测碰撞点函数,现在,我们利用数学的方法写一下判定碰撞点是否在面内的函数,如下:
bool hit_polygon (VECTOR plane_intersection , POLYGON
VECTOR Lines[triangle. Number_Of_Vertices];
float total_angles,result,
for (int a=0;triangle. Number_Of_Vertices&a;a++) //
循环操作选择的点
Lines[a]. x=plane_intersection. x-triangle. vertex[a]. //
得到方向向量
Lines[a]. y=plane_intersection. y-triangle. vertex[a].
Lines[a]. z=plane_intersection. z-triangle. vertex[a].
vlength=sqrt( (Lines[a]. x*Lines[a]. x)+(Lines[a]. y*Lines[a].
y)+(Lines[a]. z*Lines[a]. z) ); // 单位向量化
Lines[a]. x=(lines[a]. x/vlength);
Lines[a]. y=(lines[a]. y/vlength);
Lines[a]. z=(lines[a]. z/vlength);&
total_angles=0. 0; // 得到角度之和
for (int a=0;a & triangle.
Number_Of_Vertices-1;a++)
total_angles=
total_angles+acos(dotproduct(Lines[a],Lines[a+1]));&
// Loop through and calcuate the angles between each Vector
total_angles=
total_angles+acos(dotproduct(Lines[Number_Of_Vertices-1],Lines[0]));
// Last Vector done out side loop.& ( L2 , L0
)加上最后一个&
if (fabsf (total_angles-6. 28)&0. 01)//
360°=6.28弧度
//在多边形内
// 撞在了多边形的外边
结束了对点积的介绍,希望你能和我一样找到点积操作的魅力.一个小小的公式却解决了这么多的问题,这就是数学的魅力!
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

我要回帖

更多关于 高等数学向量 的文章

 

随机推荐