diff options
author | Franklin Wei <me@fwei.tk> | 2019-03-07 19:53:18 -0500 |
---|---|---|
committer | Franklin Wei <me@fwei.tk> | 2019-03-07 19:53:18 -0500 |
commit | a168c5f9d4beb1adf3451a0de8472f47e009515a (patch) | |
tree | 590de1d924b78958e0b17e0529565455328bb2b1 | |
parent | e295cf5e9f029b3e4fb3422acbb48f82231c2327 (diff) | |
download | fieldviz-a168c5f9d4beb1adf3451a0de8472f47e009515a.zip fieldviz-a168c5f9d4beb1adf3451a0de8472f47e009515a.tar.gz fieldviz-a168c5f9d4beb1adf3451a0de8472f47e009515a.tar.bz2 fieldviz-a168c5f9d4beb1adf3451a0de8472f47e009515a.tar.xz |
Documentation!
-rw-r--r-- | README.md | 52 | ||||
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | toroid.png | bin | 0 -> 186170 bytes |
3 files changed, 53 insertions, 1 deletions
@@ -21,3 +21,55 @@ This should give you a `fieldviz` executable. Run in-place or do sudo make install To install system-wide. + +# Usage + +It's all command-line based: + +Use the "add" command along with its requisite parameters to add a +current or charge element. + +For example, + + add I 10 line 0 0 0 1 0 0 + +will add a 10 amp current on a line from <0 0 0> to <1 0 0>. Different +shapes are possible, including circular arcs, solenoids, and toroids. Each will need different parameters, which are documented below. + +From there, you can either "draw" the current/charge distributions, or +plot the electric/magnetic fields they produce with the "field" command. + +## Curve parameters + +1. Line segment + + line <a> <b> + +Pretty self-explanatory. + +2. Arc + + arc <center> <radius> <normal> angle + +center, radius, and normal are all vectors. Normal should be +normalized, or bad things might happen. Angle is the extent in radians. + +3. Solenoid + + solenoid <center> <radius> <normal> angle pitch + +The first four parameters have the same meaning as they do with +arcs. The pitch parameter controls the linear distance between +successive turns. + +4. Toroid + + toroid <center> <radius> <maj_normal> min_radius maj_angle pitch + +center and radius have the same meaning as before. See the diagram +below for the meanings of the rest. + +![Toroid](https://github.com/built1n/fieldviz/raw/master/toroid.png) + +NOTE: pitch is angular distance between successive turns, or at least +it's supposed to be. Currently there's a bug somewhere. diff --git a/src/main.cpp b/src/main.cpp index 9b67ffd..b6b6c10 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -79,7 +79,7 @@ const scalar U0 = 4e-7 * M_PI; const scalar C = 299792458; const scalar E0 = 1 / ( U0 * C * C ); const scalar K_E = 1 / (4 * M_PI * E0); -const scalar D = 1e-1; +const scalar D = 1e-2; vec3 calc_Bfield(vec3 x) { diff --git a/toroid.png b/toroid.png Binary files differnew file mode 100644 index 0000000..8927b72 --- /dev/null +++ b/toroid.png |