Download presentation
Presentation is loading. Please wait.
Published byStephanie Atkins Modified over 9 years ago
1
ENE 206 Matlab 4 Coordinate systems
2
Vector and scalar quantities Vector scalar A
3
Vectors - Magnitude and direction 1. Cartesian coordinate system (x-, y-, z-)
4
Vector operation in Matlab Cartesian coordinate system Example A = 1a x + 2a y + 3a z >> A = [1 2 3] Find the magnitude of A >> norm(A) or >> abs(A)
5
Scalar product A B = |A||B|cos = ABcos Equivalent definition A B = A x B x +A y B y +A z B z Scalar projection example_101
6
Cross product A x B = |A||B|sin = ABsin Equivalent definition Matlab command is >> cross(A,B)
7
Cross product (cont.) The cross product of the two vectors A = 2a x + 1a y + 0a z and B = 1a x + 2a y + 0a z is shown. The vector product of the two vectors A and B is equal to C = 0a x + 0a y + 3a z. example_102
8
Scalar triple product A (B x C)=B (C x A) = C (A x B) >> dot(A, cross(B,C))
9
Vector triple product A x (B x C)=B(A C) -C(A B) >> cross(A, cross(B,C))
10
Volume defined by three vectors originating at a point v = area of the base x height v = (|A x B|)(C a n ) where a n = (A x B)/|A x B| A = [3 0 0]; B = [0 2 0]; C = [0 2 4]; deltav = C (A x B) example_103
11
Cylindrical coordinate system ( , , z) orthogonal point ( , , z) = a radial distance (m) = the angle measured from x axis to the projection of the radial line onto x-y plane z = a distance z (m)
12
Transformation of a vector in cylindrical coordinates to one in Cartesian coordinates A x = A a x A y = A a y A z = A a z where A is in cylindrical coordinates and assumed constant.
13
Dot products of unit vectors in Cartesian and cylindrical coordinate systems cos -sin 0 sin cos 0 001
14
Conversion of variables between Cartesian and cylindrical coordinates A conversion from P(x,y,z) to P( ρ, , z) A conversion from P( ρ, , z) to P(x,y,z) Matlab command [ph,rh,z] = cart2pol(x,y,z) Matlab command [x,y,z] = pol2cart(ph,rh,z)
15
The transformation of a vector A = 3a x + 2a y + 4a z in Cartesian coordinates into a vector in cylindrical coordinates. The unit vectors of the two coordinate systems are indicated. figure_112
16
Cylinder creation in Matlab >> [x,y,z] = cylinder(r,n); >> surf (x,y,z) where r = radius n = number of pts along the circumference.
17
Spherical coordinate system ( , , ) orthogonal point (r, , ) r = a radial distance from the origin to the point (m) = the angle measured from the positive z-axis (0 ) = an azimuthal angle, measured from x-axis (0 2 ) figure_113
18
Transformation of a vector in spherical coordinates to one in Cartesian coordinates A x = A a x A y = A a y A z = A a z where A is in spherical coordinates and assumed constant.
19
Dot products of unit vectors in Cartesian and spherical coordinates sin cos cos cos -sin sin sin cos sin cos cos -sin 0
20
Conversion of variables between Cartesian and spherical coordinate systems A conversion from P(x,y,z) to P(r, , ) A conversion from P(r, , ) to P(x,y,z) Matlab command [th,phi,r] = cart2sph(x,y,z) Matlab command [x,y,z] = sph2cart(th,phi,r)
21
Convert the Cartesian coordinate point P(3, 5, 9) to its equivalent point in cylindrical and spherical coordinates.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.