Skip to content

Edwolt/FieldViz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vector Field Vizualization

A program that let you visualize a vector field (a math function that have a vector as input and a vector as output). It works by sampling particles in the field and moving it according to the value of the vector in the field in the position

Execution

To run the program, use the following command:

cargo run --release

During execution, you can interactively change the visualized field using arrows

Changing Fields

To modify the vector fields, you'll need to edit the source code. Inside the file field.rs, there's an array of fields containing functions of the following type:

fn (f64, f64, f64) -> (f64, f64)

The first two parameters is the position in field, and the last parameter is the time from the start of the vizualization, so it's possible to make field varying by time

$$\vec{F}(x, y, t) = (x, y)$$

Example

  • $\vec{F}(x, y) = (y, x)$:

Field F(x, y) = (y, x)

  • $\vec{F}(x, y) = (\frac{y}{\sqrt{x^2 + y^2}}, -\frac{x}{\sqrt{x^2 + y^2}})$

Field Circle

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages