Correct relation equations

This commit is contained in:
Aaron Fenyes 2024-01-29 12:41:07 -05:00
parent 59a527af43
commit 0731c7aac1

View File

@ -87,7 +87,7 @@ struct LiesOn{T} <: Relation{T}
LiesOn{T}(pt::Point{T}, sph::Sphere{T}) where T = new{T}([pt, sph]) LiesOn{T}(pt::Point{T}, sph::Sphere{T}) where T = new{T}([pt, sph])
end end
equation(rel::LiesOn) = dot(rel.elements[1].vec, rel.elements[2].vec) equation(rel::LiesOn) = mprod(rel.elements[1].vec, rel.elements[2].vec)
# elements: sphere, sphere # elements: sphere, sphere
struct AlignsWithBy{T} <: Relation{T} struct AlignsWithBy{T} <: Relation{T}
@ -97,7 +97,7 @@ struct AlignsWithBy{T} <: Relation{T}
AlignsWithBy{T}(sph1::Sphere{T}, sph2::Sphere{T}, cos_angle::T) where T = new{T}([sph1, sph2], cos_angle) AlignsWithBy{T}(sph1::Sphere{T}, sph2::Sphere{T}, cos_angle::T) where T = new{T}([sph1, sph2], cos_angle)
end end
equation(rel::AlignsWithBy) = dot(rel.elements[1].vec, rel.elements[2].vec) - rel.cos_angle equation(rel::AlignsWithBy) = mprod(rel.elements[1].vec, rel.elements[2].vec) - rel.cos_angle
# --- constructions --- # --- constructions ---