2 ms·
no, this person is not suggesting a parallelogram but rather performing an affine transformation on the triangle to make it a right triangle so they can pick a
by aaronblohowiak 1y ago
no, this person is not suggesting a parallelogram but rather performing an affine transformation on the triangle to make it a right triangle so they can pick a random point in a square instead. as another commenter mentioned, I believe this distorts the distribution and won't do the right thing.
- o11c 1y agoThere's no distortion for the purposes of randomness (there would be if you cared about distance between specific points before/after the transformation), but the blog article fails to actually explain the method. Clicking through to SO explains it (but assumes you can read numpy). The `s * u` and `t * v` (where `u` and `v` are vectors) are the transformation from right-triangle (half of square) to triangle (half of parallelgram).
- saltcured 1y agoHmm, is this "car(ing) about distance between specific points" something that would matter if we were going to operate in reverse and splat something at each point to render the triangle? I think that sort of splatting is how I intuitively think about this problem, and likely where I went wrong in thinking there would be a distortion of the density function. I'm not confident whether this actually matters though. Would it still approximate the same distribution regardless of what splat shape is used...?
- creata 1y agohttps://en.wikipedia.org/wiki/Probability_density_function#Vector_to_vector https://en.wikipedia.org/wiki/Probability_density_function#V... Affine transformations just scale the probability density by a constant, so a uniform distribution is still uniform.
- aaronblohowiak 1y agoah, excellent point. thanks. this works if they are transforming the triangle to be a right triangle to make a rectangle but if they are making it half a square, that could not be accomplished solely with affine transformations (if I figure correctly...)
- cluckindan 1y agoBut you can just map one right triangle to the other without affecting the distribution.