We consider again here the

*Polar2*(`x`,`y`) = ( *tan*^{-1}(`y`/`x`), (`x`^{2} + `y`^{2})^{½})
*º* (f,`r`)

*Polar3*(`x`,`y`,`z`) =
( *cos*^{-1}(`z`(`x`^{2} + `y`^{2} + `z`^{2})^{-½},
*tan*^{-1}(`y`/`x`),
(`x`^{2} + `y`^{2} + `z`^{2})^{½}
) *º* (q,f,`r`)

Since *Polar3*(`x`,`y`,`z`) may be constructed as
(
*Polar2*(
*Polar2*(`x`,`y`)_{2} , `z`)_{1},
*Polar2*(`x`,`y`)_{1},
*Polar2*(
*Polar2*(`x`,`y`)_{2} , `z`)_{2}
)
it is *Polar2* that is fundamental.

(*d*/*d*`x`)*Polar2*(`x`,`y`)
= (-`y`(`x`^{2}+`y`^{2})^{-1} , `x`(`x`^{2}+`y`^{2})^{-½})
= (-*r*^{-1} *sin*f, *cos*f)

(*d*/*d*`y`)*Polar2*(`x`,`y`)
= ( `x`(`x`^{2}+`y`^{2})^{-1} , `y`(`x`^{2}+`y`^{2})^{-½})
= ( *r*^{-1} *cos*f, *sin*f)

(*d*/*d*`x`)^{2}*Polar2*(`x`,`y`)
= ( 2`x``y`(`x`^{2}+`y`^{2})^{-2} , `y`^{2}(`x`^{2}+`y`^{2})^{-½})
= ( *r*^{-2} *sin*(2f) , *r*^{-1}( *sin*f)^{2} )

(*d*/*d*`y`)^{2}*Polar2*(`x`,`y`)
= ( -2`x``y`(`x`^{2}+`y`^{2})^{-2} , `x`^{2}(`x`^{2}+`y`^{2})^{-½})
= ( -*r*^{-2} *sin*(2f) , *r*^{-1}( *cos*f)^{2} )

(*d*/*d*`x`)(*d*/*d*`y`)*Polar2*(`x`,`y`)
= ( (`y`^{2}-`x`^{2})(`x`^{2}+`y`^{2})^{-2} , - `x``y`(`x`^{2}+`y`^{2})^{-3/2})
= -( *r*^{-2} *cos*(2f) , ½*r*^{-1} *sin*(2f) )

Also note that
(*d*/*d*`x`)*r*^{2} = 2`x`
; (*d*/*d*`y`)*r*^{2} = 2`y`
; (*d*/*d*`x`)^{2} *r*^{2} = (*d*/*d*`y`)^{2} *r*^{2} = 2
; (*d*/*d*`x`)(*d*/*d*`y`) *r*^{2} = 0 .

One can frequently save compuations and simplfy algebra by working with (f,*r*^{2})
coordinates rather than (f,*r*).
** Euclidean Length**

The *Euclidean length* or *magnitude* of an N-dimensional vector **x**
is |**x**| = (å_{i=1}^{N} *x*_{i}^{2})^{½} .
This corresponds to our inituitive concept of "length".
It is sometimes known as the * L_{2} norm*.

The

The

For

a_{1} | a_{2} | Notes | Range of a.x when |x|=1
| |

1 | 0 | | |_{¥} | .B504 | 1.0000 |

1 | 1 | | |_{+} | 1.0000 | 1.6A08 |

1 | 3/8 | Fast | .F8E8 | 1.1168 |

31/32 | 3/8 | Fast | .F340 | 1.09F0 |

2 cos (p/8)(1+ cos (p/8))^{-1} | a_{1}(Ö2-1) | Optimal | .F5E0 | 1.0A20 |

For

a_{1} | a_{2} | a_{3}
| Notes | Range of a.x when |x|=1
| |

1 | 0 | 0 | | |_{¥} | .93CC | 1.0000 |

1 | 1 | 1 | | |_{+} | 1.0000 | 1.BB68 |

1 | 15/16 | 15/16 | Innacurate | 1.0000 | 1.A920 |

15/16 | 7/16 | 1/4 | Fast | .F000 | 1.1078 |

15/16 | 3/8 | 3/8 | Faster | .ED98 | 1.13BC |

2(1+Ö(9-2(Ö2+Ö6))^{-1} | a_{1}(Ö2-1) | a_{1}(Ö3-Ö2) | Optimal | .F098 | 1.0F68 |

**a**=(15/16,3/8,3/8) is perhaps the best, requiring only a reduced sort and
fast multiplies for a euclidean approximator within ± 7.72%.

For **x**ÎÂ^{N} with `N`>2, setting
`s _{N}` = å

We often want an estimator that never overestimates (

We have written f = *tan*^{-1}(`y`/`x`) above but this is not strictly true since f for (-`x`,-`y`)
differs by p from f for (`x`,`y`). What we require is the function C irritatingly impliments as
_incode[atan2(y,x)] but which we will denote as f(`x`,`y`) and can impliment as follows:

f(`x`,`y`) º
*tan*^{-1}(`y`/`x`) if `x`³`y`> 0
; ½p-f(`x`,`y`) if `y`>`x`>0
; p-f(-`x`,`y`) if `x`<0
; 2p-f(`x`,-`y`) if `y`<0
; p/2 if `x`=0 `y`>0
; -p/2 if `x`=0, `y`<0
; or 0 if `x`=`y`=0.

This approach only requires *tan*^{-1}() for values in the range [0,1] (*ie.* angles in [0,¼p])
and returns f in [0,2p) rather than (-p,p] . We can attain the latter range by
subtracting 2p if f>p.

Consider
F(`x`,`y`) º
`y`/`x` if `x`³`y`> 0
; ¼-F(`x`,`y`) if `y`>`x`>0
; ½-F(-`x`,`y`) if `x`<0
; 1-F(`x`,-`y`) if `y`<0
; ¼ if `x`=0 `y`>0
; -¼ if `x`=0, `y`<0
; or 0 if `x`=`y`=0.

This provides a value F[`x`,`y`] in [0,1] having the same general shape as f(`x`,`y`) which we can multipluy by 2p to obtain
a crude approximation to f(`x`,`y`) perfectly adequate for, say,
sorting points by subtended angle as when constructing a convex hull.
** Grad of distance functions**

Ñ(Ö(å_{i=1}^{N} *x*_{i}^{2})) = **x**~.

Ñ(|**x**|_{¥}) = **e _{i}**
where

Ñ(|

Next : Matrices and Orientations

Glossary Contents Author

Copyright (c) Ian C G Bell 1998

Web Source: www.iancgbell.clara.net/maths or www.bigfoot.com/~iancgbell/maths

18 Nov 2006.