From: W. Trevor King Date: Wed, 12 Aug 2009 09:45:46 +0000 (-0400) Subject: Added phi (out of plane angle) to various Vector generators. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=98460ca77d73d077665ae28fb243f70088c6b11c;p=course.git Added phi (out of plane angle) to various Vector generators. --- diff --git a/asymptote/ElectroMag.asy b/asymptote/ElectroMag.asy index 05838b4..7dd7b2e 100644 --- a/asymptote/ElectroMag.asy +++ b/asymptote/ElectroMag.asy @@ -92,16 +92,16 @@ Charge aCharge(pair center=(0,0), real q=1, real radius=2mm, pen outline=current // ---------------------- Vectors ------------------------- // electric field -Vector EField(pair center=(0,0), real mag=5mm, real dir=0, Label L="") +Vector EField(pair center=(0,0), real mag=5mm, real dir=0, real phi=0, Label L="") { - Vector v = Vector(center=center, mag=mag, dir=dir, L=L, outline=rgb(1,0.5,0.2)); // orange + Vector v = Vector(center=center, mag=mag, dir=dir, phi=phi, L=L, outline=rgb(1,0.5,0.2)); // orange return v; } // magnetic field -Vector BField(pair center=(0,0), real mag=5mm, real dir=0, Label L="") +Vector BField(pair center=(0,0), real mag=5mm, real dir=0, real phi=0, Label L="") { - Vector v = Vector(center=center, mag=mag, dir=dir, L=L, outline=rgb(0.1,1,0.2)); // green + Vector v = Vector(center=center, mag=mag, dir=dir, phi=phi, L=L, outline=rgb(0.1,1,0.2)); // green return v; } diff --git a/asymptote/Mechanics.asy b/asymptote/Mechanics.asy index ab353a0..82f8dfd 100644 --- a/asymptote/Mechanics.asy +++ b/asymptote/Mechanics.asy @@ -144,17 +144,17 @@ struct Vector { } } -Vector Velocity(pair center=(0,0), real mag=5mm, real dir=0, Label L="") +Vector Velocity(pair center=(0,0), real mag=5mm, real dir=0, real phi=0, Label L="") { - Vector v = Vector(center=center, mag=mag, dir=dir, L=L, outline=rgb(1,0.1,0.2)); // red + Vector v = Vector(center=center, mag=mag, dir=dir, phi=phi, L=L, outline=rgb(1,0.1,0.2)); // red return v; } // ---------------------- Forces ------------------------- -Vector Force(pair center=(0,0), real mag=5mm, real dir=0, Label L="") +Vector Force(pair center=(0,0), real mag=5mm, real dir=0, real phi=0, Label L="") { - Vector v = Vector(center=center, mag=mag, dir=dir, L=L, outline=rgb(0.1,0.2,1)); // blue + Vector v = Vector(center=center, mag=mag, dir=dir, phi=phi, L=L, outline=rgb(0.1,0.2,1)); // blue return v; } @@ -251,19 +251,19 @@ struct Angle { } } -Vector hatVect (string name, pair center=(0,0), real dir=0) { +Vector hatVect (string name, pair center=(0,0), real dir=0, real phi=0) { string L = replace("$\mathbf{\hat{X}}$", "X", name); - Vector v = Vector(center=center, mag=5mm, dir=dir, L=L, outline=rgb(0,0,0)); + Vector v = Vector(center=center, mag=5mm, dir=dir, phi=phi, L=L, outline=rgb(0,0,0)); return v; } -Vector ihat (pair center=(0,0), real dir=0) { - Vector v = hatVect(name="i", center=center, dir=dir); +Vector ihat (pair center=(0,0), real dir=0, real phi=0) { + Vector v = hatVect(name="i", center=center, dir=dir, phi=phi); return v; } -Vector jhat (pair center=(0,0), real dir=90) { - Vector v = hatVect(name="j", center=center, dir=dir); +Vector jhat (pair center=(0,0), real dir=90, real phi=0) { + Vector v = hatVect(name="j", center=center, dir=dir, phi=phi); return v; }