Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:

  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Matrix object constructor?

konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 914 ✭✭✭✭✭
I woiuld like to create a 2d rotation matrix and would like it to support all matrix specific operations like multiplication and others. And i cant find any matrix constructor function taking 2x2 array and giving matrix object, analogically as we have vector() function.
Currently as workaround I had to use RotationMatrix3d() and wordToPlane()

Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 449
    You can create a matrix by adding the type tag to the appropriate data structure:
    [[0, 1], [2, 3]] as Matrix
    ...but you're right that it would be more consistent to have a matrix() function which does this, as we have with vectors. Seems to me like a simple oversight, and we can add that function to the standard library in a future release. Thanks!
  • konstantin_shiriazdanovkonstantin_shiriazdanov Member Posts: 914 ✭✭✭✭✭
    thanks, @kevin_o_toole_1, it's all because I'm too used to the type of the expression is determined by the external function

Sign In or Register to comment.