-
Notifications
You must be signed in to change notification settings - Fork 41
"Type-Safe" Point
subtraction
#190
Comments
This has been discussed multiple times... Sorry, can't find the issue right now :( |
👍 I've tried to find anything related too, but I couldn't. |
@c42f do you remember where that was? |
Yes this does make complete sense; do read about affine spaces for the full detail.
Hmm good question. I recall having multiple conversations with @andyferris about this over the years but don't remember whether we really wrote it down somewhere. There's JuliaArrays/StaticArrays.jl#3 which is related. Lately @OTDE has been working on some rendering tools which has brought it back to mind. Thinking about it again, I've been starting to wonder whether there's enough practical benefit to justify modeling the affine vs vector space distinction in Julia's type system. In C++ there's value in statically proving certain correctness properties via the type system when distinguishing points from vectors (and normals). In Julia we don't get this benefit; instead we may get a very weakened version of it at runtime. In Julia I think the main value of the point-vs-vector-vs-normal distinction may come from the ability to dispatch to different methods for |
Reading https://ajeetdsouza.github.io/blog/posts/type-safe-raytracing-in-modern-cpp/ I wonder if
p1::Point - p2::Point
should return aVec
rather than aPoint
. Does that would make any sense?The text was updated successfully, but these errors were encountered: