Closed hesiod closed 9 years ago
Yes, you're right. But I'm not convinced this is a bug -- Point
s really can't be scaled. When you say that, say, an object has location (1 m, .2 m), you're really saying that the displacement of that object from some origin is (1 m, .2 m).
But I see how this makes the concepts difficult (impossible?) to use. Do you have a better design in mind?
What about a quOf
operator for affine spaces that only supports canonical units? Something like
quOfP :: forall unit dim lcsu n.
( ValidDLU dim lcsu unit
, IsCanonical unit
, AffineSpace n )
=> n -> unit -> Qu dim lcsu n
quOfP d u
= Qu d
(%.) = quOfP
Maybe I'm being a stick-in-the-mud here, but I don't like singling out canonical units in this way. As far as the type system is concerned, the choice of canonical units should be utterly irrelevant. (Specifically, my goal is: the choice of canonical units may only be observed through rounding errors.)
This needs to be addressed. But I have a major deadline in 10 days (gasp!) and want to give this proper thought, which I can't at the moment -- sorry.
The
(%)
needs its operand on the left side to be an instance ofVectorSpace
because it scales it to the canonical unit. But point quantities cannot be scaled (I don't know enough geometry to say if that makes sense).I hope I haven't forgot any parentheses this time! :smile:
Example: