1

Recently, I saw a math equation on GameDev.SE with $\|$ in it, and I was confused because this was new to me. I googled it, but being a symbol, nothing specifically on it came up in my results.

The equation is supposed to find if a circle completely contains another circle; the equation looks like this: $$d<\|r-s\|$$ in which $d$ is the distance between the two circles, and $r$ and $s$ are the two circle's radii.

I'm using this in a Fortnite simulator as I am trying to find if a player is outside of the storm circle to test if they are in the actual storm and should take damage.

Plqsmic
  • 133
  • In that context, it's probably just absolute value, usually written $|r-s|$. – Gerry Myerson Jun 24 '18 at 12:15
  • Maybe, but I've seen the same person use absolute value correctly in the same post. Here's the original post: https://gamedev.stackexchange.com/questions/7172/how-do-i-find-the-intersections-between-colliding-circles. – Plqsmic Jun 24 '18 at 12:17
  • 1
    "||a||" is the "norm" of a. If a is a number, it is just the absolute value. ||r- s|| is the difference between r and s with the sign removed. If r> s then r- s is positive so ||r- s|| is just r- s. If r< s r- s is negative so ||r- s|| is -(r- s)= s- r.0 Fmple, if r= 7 and s= 4, ||r- s||= ||7- 4||= | – user247327 Jun 24 '18 at 12:19
  • 1
    This usually denotes some kind of norm; from your context, I would guess that it means the euclidean norm. This is basically a higher dimensional analogue of the absolute value, which measures the distance from zero of its input. So $|r-s|$ is the distance of $r-s$ from zero, or equivalently, ... – Crosby Jun 24 '18 at 12:19
  • 3
    It would have been better, Java, if you had included that link in the first place. Now it's clear that $r$ and $s$ are not numbers, but vectors, so $r-s$ is a vector, and $|r-s|$ is its length. – Gerry Myerson Jun 24 '18 at 12:21
  • @GerryMyerson In the linked post, $r_1$ and $r_2$ are numbers, and the author of the first answer to it uses $\lVert \cdot \rVert$ as the absolute value, and uses $\lvert \cdot \rvert$ as the norm in $\mathbb{R}^2$ (they explain it). – user539887 Jun 24 '18 at 12:45
  • It is clearly written in the linked post that "$\Vert this \Vert$ represents absolute value". (See case 2 below eqn. (2) in the first answer). – Nash J. Jun 24 '18 at 12:48
  • 1
    In your subject line I found $|r-s|$ (coded as |r-s|) but in your question I found $||r-s||$ (coded as ||r-s||). If the difference is not conspicuous to you, contrast these: $$ \begin{align} & |a||b| \ \ & ||a|| ||b|| \end{align} $$ The first is coded as |a||b| and the second as ||a|| ||b||. $\qquad$ – Michael Hardy Jun 24 '18 at 14:15

1 Answers1

6

The author of that post is confused about the use of $|\cdot|$ and $\|\cdot\|$. They're using $|\cdot|$ for the norm of vectors and $\|\cdot\|$ for the absolute value of real numbers. The usual usage is the other way around.

You'll sometimes also find $|\cdot|$ used for the standard Euclidean norm on $\mathbb R^n$ (but rarely for more abstract norms), and since $\mathbb R=\mathbb R^1$ is a vector space and the absolute value $|\cdot|$ is its standard Euclidean norm $\|\cdot\|$, it's technically also correct to use $\|\cdot\|$ for the absolute value of real numbers.

However, doing both in one post (using $|\cdot|$ for higher-dimensional spaces and $\|\cdot\|$ for the one-dimensional space) is very unusual and unnecessarily confusing.

joriki
  • 238,052