I'm working on a calculator that automatically solves a simple equation that I'm learning in a stock trading course where you plug in some numbers from a real graph and it calculates a few numbers for you.

I'm trying to simulate a small section of real stock chart as a visual aid and using the points of a line 2D.

Here is the code I'm using to distribute the points:

``````midpoint = \$VSlider.value

line_2d.set_point_position(0,Vector2(line_2d.get_point_position(0).x,(-L1) - (midpoint) + offset
))
line_2d.set_point_position(1,Vector2(line_2d.get_point_position(1).x,(-H1) - (midpoint) + offset
))
line_2d.set_point_position(2,Vector2(line_2d.get_point_position(2).x,(-L2) - (midpoint) + offset
))
line_2d.set_point_position(3,Vector2(line_2d.get_point_position(3).x,(-H2) - (midpoint) + offset
))
line_2d.set_point_position(4,Vector2(line_2d.get_point_position(4).x,(-L3) - (midpoint) + offset
))
line_2d.set_point_position(5,Vector2(line_2d.get_point_position(5).x,(-value) - (midpoint) + offset
))
``````

(The midpoint variable is just to slide the whole thing up or down because some values will put if off the screen)

The problem is that I need a was to amplify the difference between these points, ideally controlled by a slider . Depending on the numbers I put in, the line almost looks straight because the values are so relatively similar. I need to control making the peaks higher and the valleys lower dynamically.

Godot version 4.0
in Engine