I recently encountered an issue while working on a project involving drawing points in 3D space that move according to slider values. Even though the points moved correctly, I faced difficulty in drawing a conic section (specifically a parabola) through these points.
My initial thought was that the constructor for the "conic" element might have specific requirements for how points are defined. To address this, I decided to add attributes as "sub-objects" representing points that could be referenced when drawing the conic.
In the code snippet below, the constructor function PPoint generates objects with corresponding attributes such as pcoord, which is a point object created using JSXGraph's native constructor for points. The assignment of pcoord occurs during the execution of the "draw" method to generate points I_1 to I_4 and p_1.
Despite my efforts, the parabola intended to be drawn by referencing the pcoords of I_1 to I_4 and p_1 did not appear as expected in the output. How can this issue be resolved? You can view the code snippet and execute it without any error notifications by following the link here.
HTML
<div id="jxgbox" class="jxgbox" style="width:500px; height:500px">
</div>
JS
const board = JXG.JSXGraph.initBoard('jxgbox', {
boundingbox: [-10, 10, 10, -10],
axis: true,
showCopyright: true,
showNavigation: true,
pan: false,
grid: false,
zoom: {
factorX: 1.25,
factorY: 1.25,
wheel: false
}
});
// Additional code segments and functionalities for creating sliders, axes, and other elements go here...