Skip to content

Commit

Permalink
Half of v
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Jul 23, 2018
1 parent 4ae8095 commit dae9cc6
Show file tree
Hide file tree
Showing 5 changed files with 503 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/SPICE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,4 @@ include("v.jl")
include("w.jl")
include("x.jl")



end # module
27 changes: 27 additions & 0 deletions src/n.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export nvp2pl

"""
nvp2pl(norm, point)
Make a SPICE plane from a normal vector and a point.
### Arguments ###
- `norm`: A normal vector...
- `point`: ...and a point defining a plane
### Output ###
Returns a struct representing the plane.
### References ###
- [NAIF Documentation](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/nvp2pl_c.html)
"""
function nvp2pl(norm, orig)
plane = Ref{Plane}(Plane())
ccall((:nvp2pl_c, libcspice), Cvoid,
(Ptr{SpiceDouble}, Ptr{SpiceDouble}, Ref{Plane}), norm, orig, plane)
handleerror()
plane[]
end
13 changes: 11 additions & 2 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ export
Ellipse,
center,
semi_major,
semi_minor
semi_minor,
Plane

mutable struct Ellipse
center::NTuple{3, SpiceDouble}
Expand All @@ -20,4 +21,12 @@ end

center(e::Ellipse) = collect(e.center)
semi_major(e::Ellipse) = collect(e.semi_major)
semi_minor(e::Ellipse) = collect(e.semi_minor)
semi_minor(e::Ellipse) = collect(e.semi_minor)

mutable struct Plane
normal::NTuple{3, SpiceDouble}
constant::SpiceDouble
end

Plane() = Plane((0.0, 0.0, 0.0), 0.0)

0 comments on commit dae9cc6

Please sign in to comment.