aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md52
-rw-r--r--src/main.cpp2
-rw-r--r--toroid.pngbin0 -> 186170 bytes
3 files changed, 53 insertions, 1 deletions
diff --git a/README.md b/README.md
index 99389c9..6613545 100644
--- a/README.md
+++ b/README.md
@@ -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
new file mode 100644
index 0000000..8927b72
--- /dev/null
+++ b/toroid.png
Binary files differ