How to parameterise a vector curve equation.

42 Views Asked by At

I am trying to work out the 3D equation for a line describing a 3D vector field to visualize magnetic fields such that given a point in the vector field I can draw the field line that stems from that point.

A point in the vector field is defined by $f$ where: $$ f(x, y, z)=\sum_{i=0}^{n}\left(\frac{\lambda_i\cdot \begin{pmatrix} m_{ix} - x \\ m_{iy} - y \\ m_{iz} - z \end{pmatrix} }{(m_{ix} - x)^2 + (m_{iy} - y)^2 + (m_{iz} - z)^2}\right) $$ Here $n$ represents the number of magnetic poles where $m_{ix}, m_{iy}, m_{iz}$ are the positions of the given pole $i$ and $\lambda_i$ is some constant related to each pole.

Can also be re-written as: $$ f(\alpha) = \sum_{i=0}^{n}\left(\frac{\lambda_i(m_i-\alpha)}{||m_i-\alpha||^2}\right) $$ Where $\alpha$ is a point in space and $m_i$ is point where the magnetic pole is positioned.

Currently I am visualizing the field lines by starting at a given point, $\beta$ and stepping some amount $t$ in the direction of the vector field at that point so:

$$\beta=\beta + tf(\beta)$$

Converting this into the vector line equation you get:

$$ \frac{x-\beta_x}{f(\beta)_x}=\frac{y-\beta_y}{f(\beta)_y}=\frac{z-\beta_z}{f(\beta)_z} $$

Essentially describes a line in 3D where the direction is a function of $x,y,z$ (so a 3D curve, right?).

The problem is that, from here, if I want to find points along this curve I need to provide some value for either $x$, $y$ or $z$, however for a given value of $x$, $y$ or $z$ there might not be a valid solution (the point I selected does not exist on the curve). So to fix this I believe I'll need to parameterise the line equation such that given a value $t$ I get a point $x,y,z$ on the line but I have no idea how to accomplish this.