Jump to content

Vector products: Difference between revisions

m
(Add Swift)
Line 2,074:
 
=={{header|Julia}}==
Julia provides dot and cross products aswith built-insLinearAlgebra. It's easy enough to use these to construct the triple products.
{{works with|Julia|0.6}}
<lang julia>using LinearAlgebra
Julia provides dot and cross products as built-ins. It's easy enough to use these to construct the triple products.
 
<lang julia>function scalarproduct(a::AbstractVector{T}, b::AbstractVector{T}, c::AbstractVector{T}) where {T<:Number}
return dot(a, cross(b, c))
end
4,108

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.