-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed potential->multipole dependence on t
switched to angle of vector, for shapes without polar representation (such as ellipse)
- Loading branch information
Showing
5 changed files
with
90 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Adding New Shapes | ||
|
||
ParticleScattering includes functions for drawing squircles, rounded stars, and ellipses. | ||
New shape functions can be added, provided they have the following structure: | ||
```julia | ||
function my_shape(args, N) | ||
t = Float64[π*j/N for j = 0:(2*N-1)] # or t = 0:π/N:π*(2-1/N) | ||
ft = [x y] | ||
dft = [dx/dt dy/dt] | ||
ShapeParams(t, ft, dft) | ||
end | ||
``` | ||
|
||
Where `t` is the parametrization variable, `ft[i,:] = [x(t[i]) y(t[i])]` contains the coordinates, and dft contains the derivative of `ft` with respect to `t`. | ||
In particular, the quadrature used by ParticleScattering assumes `t` | ||
are equidistantly distributed in ``[0, 2\pi)``, and that none of the points `ft` | ||
lie on the origin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters