Game Development Reference

In-Depth Information

Coordinate System

Metric Tensor

100

010

001

[

]

g

=

Cartesian coordinates

ij

100

0 0

001

[

]

2

g

=

r

Cylindrical coordinates

ij

1 0 0

0sin 0

0

[

]

g

=

r

2

2

φ

Spherical coordinates

ij

0

r

2

Table C.1.
Metric tensors.

This establishes a metric in the coordinate system
S
and reveals the source of the

metric tensor's name. If the vector
v
represents the coordinate difference between

two points, then the metric tensor is used in Equation (C.27) to obtain a (not gen-

erally Euclidean) measure of distance between the two points.

To calculate the Euclidean distance between two points, we integrate differ-

ential distances along a straight-line path. Straight lines are not generally given

by linear functions of the coordinates, so we consider an arbitrary parametric

path

()

t

in the coordinate system
S
. The length
L
of the path over the interval in

u

]

which

t

∈

[

ab

,

is given by

b

b

12

d

u

d

u

d

u

L

=

dt

=

⋅

dt

dt

dt

dt

a

a

b

12

33

du

du

i

j

=

g

dt

.

(C.28)

ij

dt

dt

i

==

11

j

a

The quantity

33

ds

2

=

g

du du

(C.29)

ij

i

j

i

==

11

j

Search Nedrilad ::

Custom Search