From 98460ca77d73d077665ae28fb243f70088c6b11c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 12 Aug 2009 05:45:46 -0400 Subject: [PATCH] Added phi (out of plane angle) to various Vector generators. --- asymptote/ElectroMag.asy | 8 ++++---- asymptote/Mechanics.asy | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) 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; } -- 2.26.2