Coder Social home page Coder Social logo

Comments (4)

aleksandrbazhin avatar aleksandrbazhin commented on June 11, 2024

Hi, thanks for feedback.
Actually, I borrowed this code from https://github.com/minillinim/ellipsoid - you can report there as well.
I tried to replicate bug by generating random sample on axis-aligned ellipsoid, before realizing that np.dot(rotation, [x[i, j], y[i, j], z[i, j]]) (proposed) and np.dot([x[i, j], y[i, j], z[i, j]], rotation) (current version) is exactly the same and is rotation[0]*x[i, j] + rotation[1]*y[i, j] + rotation[2]*z[i, j].
Could you please attach the input that is causing the error? There sure are bugs in that repository, I will try to fix them later.

from ellipsoid_fit_python.

AlanKuurstra avatar AlanKuurstra commented on June 11, 2024

According to the matlab code (https://www.mathworks.com/matlabcentral/fileexchange/24693-ellipsoid-fit), evecs "contains the radii directions as columns of the 3x3 matrix". Therefore, in order for the evecs matrix to rotate a vector [1,0,0] on the unit sphere to the correct location on the ellipsoid, one should use:
np.dot(evecs,[1,0,0]) right?

Maybe I'm missing something.

I'll try to create an example if I find some time.

from ellipsoid_fit_python.

aleksandrbazhin avatar aleksandrbazhin commented on June 11, 2024

As for my previous answer - I was mistaken, of course rotation is a matrix. But opposed to Matlab code here evecs and rotation contain radii directions as rows not columns. I don't remember why I did it, probably to be able to extract ith eigenvector with evecs[i]. Maybe it was not a good idea as it may cause confusion.
Here I transpose eigenvectors before returning

evecs = evecs.T

from ellipsoid_fit_python.

AlanKuurstra avatar AlanKuurstra commented on June 11, 2024

Oh okay, I see. I missed the transpose when I glanced over the code.
If that's the case, then the plotting should actually be fine and this issue can be closed.

from ellipsoid_fit_python.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.