ricktu288 / ray-optics

A web app for creating and simulating 2D geometric optical scenes, with a gallery of (interactive) demos.
https://phydemo.app/ray-optics/
Apache License 2.0
1.32k stars 220 forks source link

Hyperbolic functions not working #120

Closed jefffhaynes closed 9 months ago

jefffhaynes commented 9 months ago

First off, awesome simulator. Total novice here but it's been super helpful to visualize some things.

Sorry if I'm missing something, but is it possible to enter hyperbolic functions (e.g. tanh) in the function editor? It seems to grab the tan part and not want to hang out for the h.

ricktu288 commented 9 months ago

I've added the hyperbolic functions and it works fine for the tools that use Evaluatex (custom equation mirror and glass). However, for the tools that use Math.js (gradient-index glasses), tanh does not seems to work (even if sinh and cosh work).

ricktu288 commented 9 months ago

Still some weird bugs. For example, x*sinh(x) does not work.