Differences between revisions 1 and 2
Revision 1 as of 2025-12-17 20:27:16
Size: 354
Comment: Initial commit
Revision 2 as of 2025-12-17 20:35:44
Size: 740
Comment: Notes
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
Alternatively, consider a parameterized curve. To render a vector from the point on the curve for a given time to some other point, try:

{{{
syms t;

% Position functions.
x(t) = cos(t);
y(t) = -sin(t);
z(t) = t^2;

% Tangent functions.
xprime(t) = -sin(t);
yprime(t) = -cos(t);
zprime(t) = 2*t;

figure;
quiver3(x(5),y(5),z(5), xprime(5),yprime(5),zprime(5));
}}}

MATLAB quiver3

The quiver3 function creates a 3D graph of a vector.


Usage

To render a vector from the origin to the point (2,4,6), try:

figure;
quiver3(0,0,0, 2,4,6);

Alternatively, consider a parameterized curve. To render a vector from the point on the curve for a given time to some other point, try:

syms t;

% Position functions.
x(t) = cos(t);
y(t) = -sin(t);
z(t) = t^2;

% Tangent functions.
xprime(t) = -sin(t);
yprime(t) = -cos(t);
zprime(t) = 2*t;

figure;
quiver3(x(5),y(5),z(5), xprime(5),yprime(5),zprime(5));

See also figures and related commands.


CategoryRicottone

MATLAB/Quiver3 (last edited 2025-12-17 20:37:31 by DominicRicottone)