ChristopherChudzicki / math3d-react

A user-friendly 3d graphing calculator for the web. Create, share, and animate 3d mathematical scenes.
https://www.math3d.org
Mozilla Public License 2.0
245 stars 34 forks source link

how do I take a component of vector? #354

Closed v-alisei closed 1 year ago

v-alisei commented 1 year ago

Say I have a function f(x,y,z)=[-y,x,z] how do I take i-th vector parameter? f(x,y,z).x doesn't work...

v-alisei commented 1 year ago

oh, I got it) just use [f(x,y,z)[1],0,0]

ChristopherChudzicki commented 1 year ago

@v-alisei Another good option is dot products... [f(x, y, z) * i, 0, 0]. Or, depending on the circumstance, define the components of f separately.