Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a binary matrix with a rotated, ellipse-shaped region of 1s
ResourceFunction["RotatedEllipseMatrix"][{a,b},{m,n}] gives an m×n matrix whose elements are 1 in a centered, ellipse-shaped region of axis lengths a and b, and are otherwise 0. | |
ResourceFunction["RotatedEllipseMatrix"][{a,b},{m,n},θ] gives an ellipse-shaped region rotated by θ radians. | |
ResourceFunction["RotatedEllipseMatrix"][{a,b},{m,n},θ,{x0,y0}] gives an ellipse-shaped region rotated by θ radians and with center {x0,y0}. |
Generate an array plot of an ellipse matrix:
In[1]:= |
Out[1]= |
Generate an array plot of an off-centered ellipse matrix:
In[2]:= |
Out[2]= |
This work is licensed under a Creative Commons Attribution 4.0 International License