OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / math / Vector2.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy\r
5 * of this software and associated documentation files (the "Software"), to deal\r
6 * in the Software without restriction, including without limitation the rights\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
8 * copies of the Software, and to permit persons to whom the Software is\r
9 * furnished to do so, subject to the following conditions:\r
10\r
11 * The above copyright notice and this permission notice shall be included in\r
12 * all copies or substantial portions of the Software.\r
13\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "../design/Vector2Converter.h"\r
25 \r
26 #include "Vector4.h"\r
27 \r
28 using System::Runtime::InteropServices::OutAttribute;\r
29 \r
30 namespace SlimDX\r
31 {\r
32         value class Quaternion;\r
33         value class Matrix;\r
34         value class Vector3;\r
35         value class Viewport;\r
36 \r
37         /// <summary>\r
38         /// Defines a two component vector.\r
39         /// </summary>\r
40         /// <unmanaged>D3DXVECTOR2</unmanaged>\r
41         [System::Serializable]\r
42         [System::Runtime::InteropServices::StructLayout( System::Runtime::InteropServices::LayoutKind::Sequential, Pack = 4 )]\r
43         [System::ComponentModel::TypeConverter( SlimDX::Design::Vector2Converter::typeid )]\r
44         public value class Vector2 : System::IEquatable<Vector2>\r
45         {\r
46         public:\r
47                 /// <summary>\r
48                 /// Gets or sets the X component of the vector.\r
49                 /// </summary>\r
50                 /// <value>The X component of the vector.</value>\r
51                 float X;\r
52 \r
53                 /// <summary>\r
54                 /// Gets or sets the Y component of the vector.\r
55                 /// </summary>\r
56                 /// <value>The Y component of the vector.</value>\r
57                 float Y;\r
58                 \r
59                 property float default[int]\r
60                 {\r
61                         float get( int index );\r
62                         void set( int index, float value );\r
63                 }\r
64                 \r
65                 /// <summary>\r
66                 /// Gets a <see cref="Vector2"/> with all of its components set to zero.\r
67                 /// </summary>\r
68                 /// <value>A <see cref="Vector2"/> that has all of its components set to zero.</value>\r
69                 static property Vector2 Zero { Vector2 get() { return Vector2(0, 0); } }\r
70 \r
71                 /// <summary>\r
72                 /// Gets the X unit <see cref="Vector2"/> (1, 0).\r
73                 /// </summary>\r
74                 /// <value>A <see cref="Vector2"/> that has a value of (1, 0).</value>\r
75                 static property Vector2 UnitX { Vector2 get() { return Vector2(1, 0); } }\r
76 \r
77                 /// <summary>\r
78                 /// Gets the Y unit <see cref="Vector2"/> (0, 1).\r
79                 /// </summary>\r
80                 /// <value>A <see cref="Vector2"/> that has a value of (0, 1).</value>\r
81                 static property Vector2 UnitY { Vector2 get() { return Vector2(0, 1); } }\r
82 \r
83                 /// <summary>\r
84                 /// Gets the size of the <see cref="Vector2"/> type, in bytes.\r
85                 /// </summary>\r
86                 static property int SizeInBytes { int get() { return System::Runtime::InteropServices::Marshal::SizeOf(Vector2::typeid); } }\r
87 \r
88                 /// <summary>\r
89                 /// Initializes a new instance of the <see cref="Vector2"/> class.\r
90                 /// </summary>\r
91                 /// <param name="value">The value that will be assigned to all components.</param>\r
92                 Vector2( float value );         \r
93                 \r
94                 /// <summary>\r
95                 /// Initializes a new instance of the <see cref="Vector2"/> class.\r
96                 /// </summary>\r
97                 /// <param name="x">Initial value for the X component of the vector.</param>\r
98                 /// <param name="y">Initial value for the Y component of the vector.</param>\r
99                 Vector2( float x, float y );    \r
100 \r
101                 /// <summary>\r
102                 /// Calculates the length of the vector.\r
103                 /// </summary>\r
104                 /// <returns>The length of the vector.</returns>\r
105                 float Length(); \r
106 \r
107                 /// <summary>\r
108                 /// Calculates the squared length of the vector.\r
109                 /// </summary>\r
110                 /// <returns>The squared length of the vector.</returns>\r
111                 float LengthSquared();  \r
112 \r
113                 /// <summary>\r
114                 /// Converts the vector into a unit vector.\r
115                 /// </summary>\r
116                 void Normalize();\r
117                 \r
118                 /// <summary>\r
119                 /// Adds two vectors.\r
120                 /// </summary>\r
121                 /// <param name="left">The first vector to add.</param>\r
122                 /// <param name="right">The second vector to add.</param>\r
123                 /// <returns>The sum of the two vectors.</returns>\r
124                 static Vector2 Add( Vector2 left, Vector2 right );\r
125 \r
126                 /// <summary>\r
127                 /// Adds two vectors.\r
128                 /// </summary>\r
129                 /// <param name="left">The first vector to add.</param>\r
130                 /// <param name="right">The second vector to add.</param>\r
131                 /// <param name="result">When the method completes, contains the sum of the two vectors.</param>\r
132                 static void Add( Vector2% left, Vector2% right, [Out] Vector2% result );\r
133                 \r
134                 /// <summary>\r
135                 /// Subtracts two vectors.\r
136                 /// </summary>\r
137                 /// <param name="left">The first vector to subtract.</param>\r
138                 /// <param name="right">The second vector to subtract.</param>\r
139                 /// <returns>The difference of the two vectors.</returns>\r
140                 static Vector2 Subtract( Vector2 left, Vector2 right );\r
141 \r
142                 /// <summary>\r
143                 /// Subtracts two vectors.\r
144                 /// </summary>\r
145                 /// <param name="left">The first vector to subtract.</param>\r
146                 /// <param name="right">The second vector to subtract.</param>\r
147                 /// <param name="result">When the method completes, contains the difference of the two vectors.</param>\r
148                 static void Subtract( Vector2% left, Vector2% right, [Out] Vector2% result );\r
149 \r
150                 /// <summary>\r
151                 /// Scales a vector by the given value.\r
152                 /// </summary>\r
153                 /// <param name="value">The vector to scale.</param>\r
154                 /// <param name="scale">The amount by which to scale the vector.</param>\r
155                 /// <returns>The scaled vector.</returns>\r
156                 static Vector2 Multiply( Vector2 value, float scale );  \r
157 \r
158                 /// <summary>\r
159                 /// Scales a vector by the given value.\r
160                 /// </summary>\r
161                 /// <param name="vector">The vector to scale.</param>\r
162                 /// <param name="scale">The amount by which to scale the vector.</param>\r
163                 /// <param name="result">When the method completes, contains the scaled vector.</param>\r
164                 static void Multiply( Vector2% vector, float scale, [Out] Vector2% result );\r
165                 \r
166                 /// <summary>\r
167                 /// Modulates a vector by another.\r
168                 /// </summary>\r
169                 /// <param name="left">The first vector to modulate.</param>\r
170                 /// <param name="right">The second vector to modulate.</param>\r
171                 /// <returns>The modulated vector.</returns>\r
172                 static Vector2 Modulate( Vector2 left, Vector2 right );\r
173 \r
174                 /// <summary>\r
175                 /// Modulates a vector by another.\r
176                 /// </summary>\r
177                 /// <param name="left">The first vector to modulate.</param>\r
178                 /// <param name="right">The second vector to modulate.</param>\r
179                 /// <param name="result">When the moethod completes, contains the modulated vector.</param>\r
180                 static void Modulate( Vector2% left, Vector2% right, [Out] Vector2% result );\r
181                 \r
182                 /// <summary>\r
183                 /// Scales a vector by the given value.\r
184                 /// </summary>\r
185                 /// <param name="value">The vector to scale.</param>\r
186                 /// <param name="scale">The amount by which to scale the vector.</param>\r
187                 /// <returns>The scaled vector.</returns>\r
188                 static Vector2 Divide( Vector2 value, float scale );    \r
189                 \r
190                 /// <summary>\r
191                 /// Scales a vector by the given value.\r
192                 /// </summary>\r
193                 /// <param name="vector">The vector to scale.</param>\r
194                 /// <param name="scale">The amount by which to scale the vector.</param>\r
195                 /// <param name="result">When the method completes, contains the scaled vector.</param>\r
196                 static void Divide( Vector2% vector, float scale, [Out] Vector2% result );\r
197                 \r
198                 /// <summary>\r
199                 /// Reverses the direction of a given vector.\r
200                 /// </summary>\r
201                 /// <param name="value">The vector to negate.</param>\r
202                 /// <returns>A vector facing in the opposite direction.</returns>\r
203                 static Vector2 Negate( Vector2 value );\r
204 \r
205                 /// <summary>\r
206                 /// Reverses the direction of a given vector.\r
207                 /// </summary>\r
208                 /// <param name="value">The vector to negate.</param>\r
209                 /// <param name="result">When the method completes, contains a vector facing in the opposite direction.</param>\r
210                 static void Negate( Vector2% value, [Out] Vector2% result );\r
211                 \r
212                 /// <summary>\r
213                 /// Returns a <see cref="Vector2"/> containing the 2D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle.\r
214                 /// </summary>\r
215                 /// <param name="value1">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 1 of the triangle.</param>\r
216                 /// <param name="value2">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 2 of the triangle.</param>\r
217                 /// <param name="value3">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 3 of the triangle.</param>\r
218                 /// <param name="amount1">Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in <paramref name="value2"/>).</param>\r
219                 /// <param name="amount2">Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in <paramref name="value3"/>).</param>\r
220                 /// <returns>A new <see cref="Vector2"/> containing the 2D Cartesian coordinates of the specified point.</returns>\r
221                 static Vector2 Barycentric( Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2 );             \r
222 \r
223                 /// <summary>\r
224                 /// Returns a <see cref="Vector2"/> containing the 2D Cartesian coordinates of a point specified in Barycentric coordinates relative to a 2D triangle.\r
225                 /// </summary>\r
226                 /// <param name="value1">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 1 of the triangle.</param>\r
227                 /// <param name="value2">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 2 of the triangle.</param>\r
228                 /// <param name="value3">A <see cref="Vector2"/> containing the 2D Cartesian coordinates of vertex 3 of the triangle.</param>\r
229                 /// <param name="amount1">Barycentric coordinate b2, which expresses the weighting factor toward vertex 2 (specified in <paramref name="value2"/>).</param>\r
230                 /// <param name="amount2">Barycentric coordinate b3, which expresses the weighting factor toward vertex 3 (specified in <paramref name="value3"/>).</param>\r
231                 /// <param name="result">When the method completes, contains the 2D Cartesian coordinates of the specified point.</param>\r
232                 static void Barycentric( Vector2% value1, Vector2% value2, Vector2% value3, float amount1, float amount2, [Out] Vector2% result );\r
233                 \r
234                 /// <summary>\r
235                 /// Performs a Catmull-Rom interpolation using the specified positions.\r
236                 /// </summary>\r
237                 /// <param name="value1">The first position in the interpolation.</param>\r
238                 /// <param name="value2">The second position in the interpolation.</param>\r
239                 /// <param name="value3">The third position in the interpolation.</param>\r
240                 /// <param name="value4">The fourth position in the interpolation.</param>\r
241                 /// <param name="amount">Weighting factor.</param>\r
242                 /// <returns>A vector that is the result of the Catmull-Rom interpolation.</returns>\r
243                 static Vector2 CatmullRom( Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount );\r
244 \r
245                 /// <summary>\r
246                 /// Performs a Catmull-Rom interpolation using the specified positions.\r
247                 /// </summary>\r
248                 /// <param name="value1">The first position in the interpolation.</param>\r
249                 /// <param name="value2">The second position in the interpolation.</param>\r
250                 /// <param name="value3">The third position in the interpolation.</param>\r
251                 /// <param name="value4">The fourth position in the interpolation.</param>\r
252                 /// <param name="amount">Weighting factor.</param>\r
253                 /// <param name="result">When the method completes, contains the result of the Catmull-Rom interpolation.</param>\r
254                 static void CatmullRom( Vector2% value1, Vector2% value2, Vector2% value3, Vector2% value4, float amount, [Out] Vector2% result );\r
255                 \r
256                 /// <summary>\r
257                 /// Restricts a value to be within a specified range.\r
258                 /// </summary>\r
259                 /// <param name="value">The value to clamp.</param>\r
260                 /// <param name="min">The minimum value.</param>\r
261                 /// <param name="max">The maximum value.</param>\r
262                 /// <returns>The clamped value.</returns>\r
263                 static Vector2 Clamp( Vector2 value, Vector2 min, Vector2 max );\r
264 \r
265                 /// <summary>\r
266                 /// Restricts a value to be within a specified range.\r
267                 /// </summary>\r
268                 /// <param name="value">The value to clamp.</param>\r
269                 /// <param name="min">The minimum value.</param>\r
270                 /// <param name="max">The maximum value.</param>\r
271                 /// <param name="result">When the method completes, contains the clamped value.</param>\r
272                 static void Clamp( Vector2% value, Vector2% min, Vector2% max, [Out] Vector2% result );         \r
273                 \r
274                 /// <summary>\r
275                 /// Performs a Hermite spline interpolation.\r
276                 /// </summary>\r
277                 /// <param name="value1">First source position vector.</param>\r
278                 /// <param name="tangent1">First source tangent vector.</param>\r
279                 /// <param name="value2">Second source position vector.</param>\r
280                 /// <param name="tangent2">Second source tangent vector.</param>\r
281                 /// <param name="amount">Weighting factor.</param>\r
282                 /// <returns>The result of the Hermite spline interpolation.</returns>\r
283                 static Vector2 Hermite( Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount );\r
284                 \r
285                 /// <summary>\r
286                 /// Performs a Hermite spline interpolation.\r
287                 /// </summary>\r
288                 /// <param name="value1">First source position vector.</param>\r
289                 /// <param name="tangent1">First source tangent vector.</param>\r
290                 /// <param name="value2">Second source position vector.</param>\r
291                 /// <param name="tangent2">Second source tangent vector.</param>\r
292                 /// <param name="amount">Weighting factor.</param>\r
293                 /// <param name="result">When the method completes, contains the result of the Hermite spline interpolation.</param>\r
294                 static void Hermite( Vector2% value1, Vector2% tangent1, Vector2% value2, Vector2% tangent2, float amount, [Out] Vector2% result );\r
295                 \r
296                 /// <summary>\r
297                 /// Performs a linear interpolation between two vectors.\r
298                 /// </summary>\r
299                 /// <param name="start">Start vector.</param>\r
300                 /// <param name="end">End vector.</param>\r
301                 /// <param name="amount">Value between 0 and 1 indicating the weight of <paramref name="end"/>.</param>\r
302                 /// <returns>The linear interpolation of the two vectors.</returns>\r
303                 /// <remarks>\r
304                 /// This method performs the linear interpolation based on the following formula.\r
305                 /// <code>start + (end - start) * amount</code>\r
306                 /// Passing <paramref name="amount"/> a value of 0 will cause <paramref name="start"/> to be returned; a value of 1 will cause <paramref name="end"/> to be returned. \r
307                 /// </remarks>\r
308                 static Vector2 Lerp( Vector2 start, Vector2 end, float amount );\r
309 \r
310                 /// <summary>\r
311                 /// Performs a linear interpolation between two vectors.\r
312                 /// </summary>\r
313                 /// <param name="start">Start vector.</param>\r
314                 /// <param name="end">End vector.</param>\r
315                 /// <param name="amount">Value between 0 and 1 indicating the weight of <paramref name="end"/>.</param>\r
316                 /// <param name="result">When the method completes, contains the linear interpolation of the two vectors.</param>\r
317                 /// <remarks>\r
318                 /// This method performs the linear interpolation based on the following formula.\r
319                 /// <code>start + (end - start) * amount</code>\r
320                 /// Passing <paramref name="amount"/> a value of 0 will cause <paramref name="start"/> to be returned; a value of 1 will cause <paramref name="end"/> to be returned. \r
321                 /// </remarks>\r
322                 static void Lerp( Vector2% start, Vector2% end, float amount, [Out] Vector2% result );          \r
323                 \r
324                 /// <summary>\r
325                 /// Performs a cubic interpolation between two vectors.\r
326                 /// </summary>\r
327                 /// <param name="start">Start vector.</param>\r
328                 /// <param name="end">End vector.</param>\r
329                 /// <param name="amount">Value between 0 and 1 indicating the weight of <paramref name="end"/>.</param>\r
330                 /// <returns>The cubic interpolation of the two vectors.</returns>\r
331                 static Vector2 SmoothStep( Vector2 start, Vector2 end, float amount );          \r
332 \r
333                 /// <summary>\r
334                 /// Performs a cubic interpolation between two vectors.\r
335                 /// </summary>\r
336                 /// <param name="start">Start vector.</param>\r
337                 /// <param name="end">End vector.</param>\r
338                 /// <param name="amount">Value between 0 and 1 indicating the weight of <paramref name="end"/>.</param>\r
339                 /// <param name="result">When the method completes, contains the cubic interpolation of the two vectors.</param>\r
340                 static void SmoothStep( Vector2% start, Vector2% end, float amount, [Out] Vector2% result );\r
341                 \r
342                 /// <summary>\r
343                 /// Calculates the distance between two vectors.\r
344                 /// </summary>\r
345                 /// <param name="value1">The first vector.</param>\r
346                 /// <param name="value2">The second vector.</param>\r
347                 /// <returns>The distance between the two vectors.</returns>\r
348                 static float Distance( Vector2 value1, Vector2 value2 );\r
349 \r
350                 /// <summary>\r
351                 /// Calculates the squared distance between two vectors.\r
352                 /// </summary>\r
353                 /// <param name="value1">The first vector.</param>\r
354                 /// <param name="value2">The second vector.</param>\r
355                 /// <returns>The squared distance between the two vectors.</returns>\r
356                 /// <remarks>Distance squared is the value before taking the square root. \r
357                 /// Distance squared can often be used in place of distance if relative comparisons are being made. \r
358                 /// For example, consider three points A, B, and C. To determine whether B or C is further from A, \r
359                 /// compare the distance between A and B to the distance between A and C. Calculating the two distances \r
360                 /// involves two square roots, which are computationally expensive. However, using distance squared \r
361                 /// provides the same information and avoids calculating two square roots.\r
362                 /// </remarks>\r
363                 static float DistanceSquared( Vector2 value1, Vector2 value2 );\r
364 \r
365                 /// <summary>\r
366                 /// Calculates the dot product of two vectors.\r
367                 /// </summary>\r
368                 /// <param name="left">First source vector.</param>\r
369                 /// <param name="right">Second source vector.</param>\r
370                 /// <returns>The dot product of the two vectors.</returns>\r
371                 static float Dot( Vector2 left, Vector2 right );\r
372 \r
373                 /// <summary>\r
374                 /// Converts the vector into a unit vector.\r
375                 /// </summary>\r
376                 /// <param name="vector">The vector to normalize.</param>\r
377                 /// <returns>The normalized vector.</returns>\r
378                 static Vector2 Normalize( Vector2 vector );\r
379 \r
380                 /// <summary>\r
381                 /// Converts the vector into a unit vector.\r
382                 /// </summary>\r
383                 /// <param name="vector">The vector to normalize.</param>\r
384                 /// <param name="result">When the method completes, contains the normalized vector.</param>\r
385                 static void Normalize( Vector2% vector, [Out] Vector2% result );\r
386 \r
387                 /// <summary>\r
388                 /// Transforms a 2D vector by the given <see cref="SlimDX::Matrix"/>.\r
389                 /// </summary>\r
390                 /// <param name="vector">The source vector.</param>\r
391                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
392                 /// <returns>The transformed <see cref="SlimDX::Vector4"/>.</returns>\r
393                 static Vector4 Transform( Vector2 vector, Matrix transformation );\r
394 \r
395                 /// <summary>\r
396                 /// Transforms a 2D vector by the given <see cref="SlimDX::Matrix"/>.\r
397                 /// </summary>\r
398                 /// <param name="vector">The source vector.</param>\r
399                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
400                 /// <param name="result">When the method completes, contains the transformed <see cref="SlimDX::Vector4"/>.</param>\r
401                 static void Transform( Vector2% vector, Matrix% transformation, [Out] Vector4% result );\r
402 \r
403                 /// <summary>\r
404                 /// Transforms an array of 2D vectors by the given <see cref="SlimDX::Matrix"/>.\r
405                 /// </summary>\r
406                 /// <param name="vectors">The source vectors.</param>\r
407                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
408                 /// <returns>The transformed <see cref="SlimDX::Vector4"/>s.</returns>\r
409                 static array<Vector4>^ Transform( array<Vector2>^ vectors, Matrix% transformation );\r
410 \r
411                 /// <summary>\r
412                 /// Transforms a 2D vector by the given <see cref="SlimDX::Quaternion"/> rotation.\r
413                 /// </summary>\r
414                 /// <param name="vector">The vector to rotate.</param>\r
415                 /// <param name="rotation">The <see cref="SlimDX::Quaternion"/> rotation to apply.</param>\r
416                 /// <returns>The transformed <see cref="SlimDX::Vector4"/>.</returns>\r
417                 static Vector4 Transform( Vector2 vector, Quaternion rotation );\r
418 \r
419                 /// <summary>\r
420                 /// Transforms a 2D vector by the given <see cref="SlimDX::Quaternion"/> rotation.\r
421                 /// </summary>\r
422                 /// <param name="vector">The vector to rotate.</param>\r
423                 /// <param name="rotation">The <see cref="SlimDX::Quaternion"/> rotation to apply.</param>\r
424                 /// <param name="result">When the method completes, contains the transformed <see cref="SlimDX::Vector4"/>.</param>\r
425                 static void Transform( Vector2% vector, Quaternion% rotation, [Out] Vector4% result );\r
426 \r
427                 /// <summary>\r
428                 /// Transforms an array of 2D vectors by the given <see cref="SlimDX::Quaternion"/> rotation.\r
429                 /// </summary>\r
430                 /// <param name="vectors">The vectors to rotate.</param>\r
431                 /// <param name="rotation">The <see cref="SlimDX::Quaternion"/> rotation to apply.</param>\r
432                 /// <returns>The transformed <see cref="SlimDX::Vector4"/>.</returns>\r
433                 static array<Vector4>^ Transform( array<Vector2>^ vectors, Quaternion% rotation );\r
434 \r
435                 /// <summary>\r
436                 /// Performs a coordinate transformation using the given <see cref="SlimDX::Matrix"/>.\r
437                 /// </summary>\r
438                 /// <param name="coordinate">The coordinate vector to transform.</param>\r
439                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
440                 /// <returns>The transformed coordinates.</returns>\r
441                 static Vector2 TransformCoordinate( Vector2 coordinate, Matrix transformation );\r
442 \r
443                 /// <summary>\r
444                 /// Performs a coordinate transformation using the given <see cref="SlimDX::Matrix"/>.\r
445                 /// </summary>\r
446                 /// <param name="coordinate">The coordinate vector to transform.</param>\r
447                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
448                 /// <param name="result">When the method completes, contains the transformed coordinates.</param>\r
449                 static void TransformCoordinate( Vector2% coordinate, Matrix% transformation, [Out] Vector2% result );\r
450 \r
451                 /// <summary>\r
452                 /// Performs a coordinate transformation using the given <see cref="SlimDX::Matrix"/>.\r
453                 /// </summary>\r
454                 /// <param name="coordinates">The coordinate vectors to transform.</param>\r
455                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
456                 /// <returns>The transformed coordinates.</returns>\r
457                 static array<Vector2>^ TransformCoordinate( array<Vector2>^ coordinates, Matrix% transformation );\r
458                 \r
459                 /// <summary>\r
460                 /// Performs a normal transformation using the given <see cref="SlimDX::Matrix"/>.\r
461                 /// </summary>\r
462                 /// <param name="normal">The normal vector to transform.</param>\r
463                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
464                 /// <returns>The transformed normal.</returns>\r
465                 static Vector2 TransformNormal( Vector2 normal, Matrix transformation );\r
466 \r
467                 /// <summary>\r
468                 /// Performs a normal transformation using the given <see cref="SlimDX::Matrix"/>.\r
469                 /// </summary>\r
470                 /// <param name="normal">The normal vector to transform.</param>\r
471                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
472                 /// <param name="result">When the method completes, contains the transformed normal.</param>\r
473                 static void TransformNormal( Vector2% normal, Matrix% transformation, [Out] Vector2% result );\r
474 \r
475                 /// <summary>\r
476                 /// Performs a normal transformation using the given <see cref="SlimDX::Matrix"/>.\r
477                 /// </summary>\r
478                 /// <param name="normals">The normal vectors to transform.</param>\r
479                 /// <param name="transformation">The transformation <see cref="SlimDX::Matrix"/>.</param>\r
480                 /// <returns>The transformed normals.</returns>\r
481                 static array<Vector2>^ TransformNormal( array<Vector2>^ normals, Matrix% transformation );\r
482 \r
483                 /// <summary>\r
484                 /// Returns a vector containing the smallest components of the specified vectors.\r
485                 /// </summary>\r
486                 /// <param name="value1">The first source vector.</param>\r
487                 /// <param name="value2">The second source vector.</param>\r
488                 /// <returns>A vector containing the smallest components of the source vectors.</returns>\r
489                 static Vector2 Minimize( Vector2 value1, Vector2 value2 );\r
490 \r
491                 /// <summary>\r
492                 /// Returns a vector containing the smallest components of the specified vectors.\r
493                 /// </summary>\r
494                 /// <param name="value1">The first source vector.</param>\r
495                 /// <param name="value2">The second source vector.</param>\r
496                 /// <param name="result">When the method completes, contains an new vector composed of the smallest components of the source vectors.</param>\r
497                 static void Minimize( Vector2% value1, Vector2% value2, [Out] Vector2% result );\r
498                 \r
499                 /// <summary>\r
500                 /// Returns a vector containing the largest components of the specified vectors.\r
501                 /// </summary>\r
502                 /// <param name="value1">The first source vector.</param>\r
503                 /// <param name="value2">The second source vector.</param>\r
504                 /// <returns>A vector containing the largest components of the source vectors.</returns>\r
505                 static Vector2 Maximize( Vector2 value1, Vector2 value2 );\r
506                 \r
507                 /// <summary>\r
508                 /// Returns a vector containing the smallest components of the specified vectors.\r
509                 /// </summary>\r
510                 /// <param name="value1">The first source vector.</param>\r
511                 /// <param name="value2">The second source vector.</param>\r
512                 /// <param name="result">When the method completes, contains an new vector composed of the largest components of the source vectors.</param>\r
513                 static void Maximize( Vector2% value1, Vector2% value2, [Out] Vector2% result );\r
514 \r
515                 /// <summary>\r
516                 /// Adds two vectors.\r
517                 /// </summary>\r
518                 /// <param name="left">The first vector to add.</param>\r
519                 /// <param name="right">The second vector to add.</param>\r
520                 /// <returns>The sum of the two vectors.</returns>\r
521                 static Vector2 operator + ( Vector2 left, Vector2 right );\r
522 \r
523                 /// <summary>\r
524                 /// Subtracts two vectors.\r
525                 /// </summary>\r
526                 /// <param name="left">The first vector to subtract.</param>\r
527                 /// <param name="right">The second vector to subtract.</param>\r
528                 /// <returns>The difference of the two vectors.</returns>\r
529                 static Vector2 operator - ( Vector2 left, Vector2 right );\r
530 \r
531                 /// <summary>\r
532                 /// Reverses the direction of a given vector.\r
533                 /// </summary>\r
534                 /// <param name="value">The vector to negate.</param>\r
535                 /// <returns>A vector facing in the opposite direction.</returns>\r
536                 static Vector2 operator - ( Vector2 value );\r
537 \r
538                 /// <summary>\r
539                 /// Scales a vector by the given value.\r
540                 /// </summary>\r
541                 /// <param name="vector">The vector to scale.</param>\r
542                 /// <param name="scale">The amount by which to scale the vector.</param>\r
543                 /// <returns>The scaled vector.</returns>\r
544                 static Vector2 operator * ( Vector2 vector, float scale );\r
545 \r
546                 /// <summary>\r
547                 /// Scales a vector by the given value.\r
548                 /// </summary>\r
549                 /// <param name="vector">The vector to scale.</param>\r
550                 /// <param name="scale">The amount by which to scale the vector.</param>\r
551                 /// <returns>The scaled vector.</returns>\r
552                 static Vector2 operator * ( float scale, Vector2 vector );\r
553 \r
554                 /// <summary>\r
555                 /// Scales a vector by the given value.\r
556                 /// </summary>\r
557                 /// <param name="vector">The vector to scale.</param>\r
558                 /// <param name="scale">The amount by which to scale the vector.</param>\r
559                 /// <returns>The scaled vector.</returns>\r
560                 static Vector2 operator / ( Vector2 vector, float scale );\r
561 \r
562                 /// <summary>\r
563                 /// Tests for equality between two objects.\r
564                 /// </summary>\r
565                 /// <param name="left">The first value to compare.</param>\r
566                 /// <param name="right">The second value to compare.</param>\r
567                 /// <returns><c>true</c> if <paramref name="left"/> has the same value as <paramref name="right"/>; otherwise, <c>false</c>.</returns>\r
568                 static bool operator == ( Vector2 left, Vector2 right );\r
569 \r
570                 /// <summary>\r
571                 /// Tests for inequality between two objects.\r
572                 /// </summary>\r
573                 /// <param name="left">The first value to compare.</param>\r
574                 /// <param name="right">The second value to compare.</param>\r
575                 /// <returns><c>true</c> if <paramref name="left"/> has a different value than <paramref name="right"/>; otherwise, <c>false</c>.</returns>\r
576                 static bool operator != ( Vector2 left, Vector2 right );\r
577 \r
578                 /// <summary>\r
579                 /// Converts the value of the object to its equivalent string representation.\r
580                 /// </summary>\r
581                 /// <returns>The string representation of the value of this instance.</returns>\r
582                 virtual System::String^ ToString() override;\r
583 \r
584                 /// <summary>\r
585                 /// Returns the hash code for this instance.\r
586                 /// </summary>\r
587                 /// <returns>A 32-bit signed integer hash code.</returns>\r
588                 virtual int GetHashCode() override;\r
589 \r
590                 /// <summary>\r
591                 /// Returns a value that indicates whether the current instance is equal to a specified object. \r
592                 /// </summary>\r
593                 /// <param name="obj">Object to make the comparison with.</param>\r
594                 /// <returns><c>true</c> if the current instance is equal to the specified object; <c>false</c> otherwise.</returns>\r
595                 virtual bool Equals( System::Object^ obj ) override;\r
596 \r
597                 /// <summary>\r
598                 /// Returns a value that indicates whether the current instance is equal to the specified object. \r
599                 /// </summary>\r
600                 /// <param name="other">Object to make the comparison with.</param>\r
601                 /// <returns><c>true</c> if the current instance is equal to the specified object; <c>false</c> otherwise.</returns>\r
602                 virtual bool Equals( Vector2 other );\r
603 \r
604                 /// <summary>\r
605                 /// Determines whether the specified object instances are considered equal. \r
606                 /// </summary>\r
607                 /// <param name="value1">The first value to compare.</param>\r
608                 /// <param name="value2">The second value to compare.</param>\r
609                 /// <returns><c>true</c> if <paramref name="value1"/> is the same instance as <paramref name="value2"/> or \r
610                 /// if both are <c>null</c> references or if <c>value1.Equals(value2)</c> returns <c>true</c>; otherwise, <c>false</c>.</returns>\r
611                 static bool Equals( Vector2% value1, Vector2% value2 );\r
612         };\r
613 }\r