Coder Social home page Coder Social logo

Comments (2)

mars0i avatar mars0i commented on May 10, 2024 1

That's it--I didn't notice that z had to be rotated relative to x and y. Thanks!

from owl.

ryanrhymes avatar ryanrhymes commented on May 10, 2024

@mars0i I think the reason is the shape of these matrices don't match. The z should have shape 9 x 8 instead of 8 x 9. So if you use meshgrid to create these two matrices x and y, then you can write

let x, y = Mat.meshgrid 0. 8. 0. 7. 9 8;;

   C0 C1 C2 C3 C4 C5 C6 C7 C8                                                                                                                                                        R0  0  1  2  3  4  5  6  7  8                                                                                                                                                        
R1  0  1  2  3  4  5  6  7  8
R2  0  1  2  3  4  5  6  7  8
R3  0  1  2  3  4  5  6  7  8
R4  0  1  2  3  4  5  6  7  8
R5  0  1  2  3  4  5  6  7  8
R6  0  1  2  3  4  5  6  7  8
R7  0  1  2  3  4  5  6  7  8


   C0 C1 C2 C3 C4 C5 C6 C7 C8
R0  0  0  0  0  0  0  0  0  0
R1  1  1  1  1  1  1  1  1  1
R2  2  2  2  2  2  2  2  2  2
R3  3  3  3  3  3  3  3  3  3
R4  4  4  4  4  4  4  4  4  4
R5  5  5  5  5  5  5  5  5  5
R6  6  6  6  6  6  6  6  6  6
R7  7  7  7  7  7  7  7  7  7

(* then z should be 9 x 8 *)
let z = Mat.uniform 9 8;;

         C0       C1       C2       C3        C4       C5       C6       C7                                                                                                          R0 0.222671 0.434721 0.650298 0.518921  0.881284 0.802989  0.91419 0.493246                                                                                                          
R1 0.816488 0.249789  0.23474 0.653041  0.903702 0.776013 0.528878 0.786525
R2 0.881226 0.311529 0.215572 0.138114  0.800453 0.869957 0.356799 0.739012
R3 0.285757 0.575163 0.453706 0.856444  0.848671 0.267722 0.811779 0.436114
R4 0.670338  0.27585 0.271778 0.730103  0.485819 0.965297 0.415441 0.329227
R5 0.833202 0.493767 0.874061 0.965179  0.806662 0.191208 0.541577 0.468292
R6 0.457119 0.457139  0.27113 0.136853  0.534103 0.973245   0.8913 0.969978
R7 0.527856 0.856772 0.712637 0.134343 0.0414307  0.51925 0.190386 0.615259
R8  0.79921 0.171861 0.863142 0.279621  0.981742  0.57437 0.638904 0.681927

Plot.plot3d x y z;;

from owl.

Related Issues (20)

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.