How to know if the given vector is less or greater than the other vector?

  • Context: Undergrad 
  • Thread starter Thread starter sarah22
  • Start date Start date
  • Tags Tags
    Vector
Click For Summary
SUMMARY

The discussion centers on determining if one vector is less than or greater than another vector in the context of creating a Bounding Box for a game engine. The primary method suggested is to compare the lengths of the vectors using norms, specifically the Euclidean norm. The formula for the norm in two dimensions is given as ||(a, b)|| = √(a² + b²), and for n dimensions as ||x|| = √(x₁² + x₂² + ... + xₙ²). It is emphasized that there is no standard definition for "less" or "greater" when comparing vectors, as many vectors can share the same length.

PREREQUISITES
  • Understanding of vector mathematics
  • Familiarity with Euclidean norms
  • Basic knowledge of linear algebra concepts
  • Experience with 3D graphics programming
NEXT STEPS
  • Research the properties of Euclidean norms in higher dimensions
  • Explore vector comparison techniques in linear algebra
  • Learn about Bounding Box algorithms in game development
  • Investigate alternative vector comparison methods beyond length
USEFUL FOR

This discussion is beneficial for game developers, 3D graphics programmers, and students learning linear algebra who are interested in vector mathematics and its applications in computer graphics.

sarah22
Messages
26
Reaction score
0
I'm creating a Bounding Box for my game engine right now and I need to get the vector min and max of the given model. I'm going to loop on all vertices then check if is the minimum or the maximum then use it to draw a box on the whole model.

I'm new in linear algebra and also new in 3D world. Is there any formula on how to know if the given vector is less or greater than the other vector?
 
Physics news on Phys.org
If you are comparing their lengths/magnitudes, using norms should work. Norm is kind of a fancy term for length in most cases.

The easiest way to visualize a norm is to consider the two-dimensional case. If we have some vector (a, b) then we can find its length by considering the horizontal and vertical projections. The horizontal component is a horizontal line segment (along the x-axis) of length a (x runs from 0 to a). The vertical component, similarly, is of length b (y runs from 0 to b). We now just have a right triangle and can use the Pythagorean theorem to find the length of (a, b). The norm is usually indicated by notation similar to absolute value bars or some texts use two absolute value bars.

||(a, b)|| = \sqrt[]{a^2 + b^2}

Vectors with more than two components are pretty similar for the Euclidean norm.

If x = (x_1, x_2, ..., x_n) then

||x|| = \sqrt[]{x_1^2 + x_2^2 + ... + x_n^2}
 
You would first have to define what you mean "less" or "greater" for vectors- there is no standard definition. About the best you can do is pbandjay's suggestion: order vectors by their length. That is not a "linear order" and does NOT satisfy "tricotomy" (given two objects that are not equal, one is "less" than the other)- many non-equal vectors have the same length and so are not "less" or "greater" than each other.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 50 ·
2
Replies
50
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K