mathnet-spatial icon indicating copy to clipboard operation
mathnet-spatial copied to clipboard

Multiply CoordinateSystem and Vector3D is without offset

Open Ralle opened this issue 8 years ago • 3 comments

The offset is ignored in this method and similar ones: https://github.com/mathnet/mathnet-spatial/blob/master/src/Spatial/Euclidean/CoordinateSystem.cs#L432

What you have to do is to convert the vector from (x,y,z) to (x,y,z,1) and multiply it with the matrix, then divide (x,y,z) with the value of w and return (x,y,z).

Ralle avatar Aug 03 '15 08:08 Ralle

The CoordinateSystem class is a huge mess. The API and perf is really poor. Do you want to have a go at fixing the bug with a PR?

JohanLarsson avatar Aug 03 '15 10:08 JohanLarsson

Thanks but no thanks. I am just looking for something that works :)

Ralle avatar Aug 03 '15 10:08 Ralle

@Ralle why do you say that we need offset for vectors? The offset (or origin) is only relevant for points. The updated line is this https://github.com/mathnet/mathnet-spatial/blob/master/src/Spatial/Euclidean/CoordinateSystem.cs#L378.

Do you agree?

jkalias avatar Apr 13 '23 12:04 jkalias