# Add a custom cast?

**URL:** <https://discourse.processing.org/t/add-a-custom-cast/22995>\
**Category:** Development\
**Created:** [August 2, 2020, 3:46pm UTC](https://discourse.processing.org/t/add-a-custom-cast/22995 "2020-08-02T15:46:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 2, 2020, 5:15pm UTC](https://discourse.processing.org/t/add-a-custom-cast/22995/2 "2020-08-02T17:15:57Z")

</div>

Can’t you just create a `static` method (or alt. an overloaded constuctor) which converts a `float[][]` to a Matrix, like `static final Matrix.fromFloatArray2d(final float[][] arr2d) {}`? 💡

---

_[View the full topic](https://discourse.processing.org/t/add-a-custom-cast/22995)._
