File size: 764 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import Mathlib
namespace OAI
noncomputable section
open scoped InnerProductSpace
namespace CylinderNormalFrame
abbrev Space := EuclideanSpace β (Fin 3)
abbrev BarycentricSpace := EuclideanSpace β (Fin 4)
def normal (i : Fin 4) : Space :=
(1 / Real.sqrt 3) β’ ![(!β[0, Real.sqrt 2, -1] : Space),
!β[0, -Real.sqrt 2, -1],
!β[Real.sqrt 2, 0, 1],
!β[-Real.sqrt 2, 0, 1]] i
def frameCost (u : Space) : β :=
Real.sqrt 3 / 2 * β i : Fin 4, |inner β u (normal i)|
def barycentricCost (u : BarycentricSpace) : β :=
(1 / 2 : β) * β i : Fin 4, |u i|
def edgeDirection : Space := !β[1, 0, 0]
def barycentricEdge : BarycentricSpace :=
!β[1 / Real.sqrt 2, -(1 / Real.sqrt 2), 0, 0]
end CylinderNormalFrame
end
end OAI
|