Skip to content

Matrix

The <Matrix> primitive renders a two-dimensional array of values surrounded by square brackets, perfect for linear algebra and systems-of-equations scenes.

1000cos θ−sin θ0sin θcos θ
0.00s / 1.97s · F0
PropTypeDefaultDescription
values(number | string)[][]2D array of cell values
xnumber0X position of the matrix
ynumber0Y position of the matrix
cellSizenumber40Width and height of each cell in pixels
colorstring'currentColor'Text color for cell values
bracketColorstring'currentColor'Color of the surrounding brackets
fontSizenumber16Font size of cell values
fadeInbooleanfalseAnimate the matrix in on mount
import { Player, FadeIn, Matrix } from '@elucim/core';
<Player width={500} height={300} fps={30} durationInFrames={60}>
<FadeIn duration={20}>
<Matrix
values={[[1, 0, 0], [0, 'cos θ', '-sin θ'], [0, 'sin θ', 'cos θ']]}
x={250} y={150} cellSize={55}
color="currentColor" bracketColor="#6c5ce7"
/>
</FadeIn>
</Player>