hey, i’m tryng to learn some concepts on verse and one of this concepts are Parabolas
I know this isn’t simple but if anyone already worked on this and feel comfortable sharing how it works i will be extremely glad!
hey, i’m tryng to learn some concepts on verse and one of this concepts are Parabolas
I know this isn’t simple but if anyone already worked on this and feel comfortable sharing how it works i will be extremely glad!
Maybe this is something you are looking for. Two functions that print out the equation, focus and vertex points and some of the other stuff related to parabolas. One function for parabolas in respect to y-axis and one for x-axis
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
# A Verse-authored creative device that can be placed in a level
ParabolaEquation := class(creative_device):
@editable Value_P: float = 2.0
@editable Value_H: float = 3.0
@editable Value_K: float = -5.0
# Runs when the device is started in a running game
OnBegin<override>()<suspends>:void=
Print("Parabola in respect to y-axis")
Parabola_Y(Value_P, Value_H, Value_K)
Print("")
Print("Parabola in respect to x-axis")
Parabola_X(Value_P, Value_H, Value_K)
# Parabolas that are parallel to the y-axis
Parabola_Y(P: float, H: float, K: float, ?X: ?float = false, ?Y: ?float = false): void=
Print("Equation: (x-({H}))² = {4*P}(y-({K}))")
Print("Vertex: ({H},{K})")
Print("Focus: ({H},{K+P})")
Print("Directrix: y = {K-P}")
Print("Symmetry axis: x = {H}")
if (P > 0.0):
Print("Direction of opening: Upward")
else if (P < 0.0):
Print("Direction of opening: Downward")
else:
Print("P equals to zero on NaN")
# Evaluate the equation if x and y values are available
if (IsNumberX:= X?, IsNumberY:= Y?):
LeftSide:= Pow(IsNumberX-H, 2.0)
RightSide:= 4*P*(IsNumberY-K)
Print("Result of the left side of the equation: {LeftSide}")
Print("Result of the Right side of the equation: {RightSide}")
# Parabolas that are parallel to the x-axis
Parabola_X(P: float, H: float, K: float, ?X: ?float = false, ?Y: ?float = false): void=
Print("Equation: (y-({K}))² = {4*P}(x-({H}))")
Print("Vertex: ({H},{K})")
Print("Focus: ({H+P},{K})")
Print("Directrix: x = {H-P}")
Print("Symmetry axis: Y = {K}")
if (P > 0.0):
Print("Direction of opening: Right")
else if (P < 0.0):
Print("Direction of opening: Left")
else:
Print("P equals to zero on NaN")
# Evaluate the equation if x and y values are available
if (IsNumberX:= X?, IsNumberY:= Y?):
LeftSide:= Pow(IsNumberY-K, 2.0)
RightSide:= 4*P*(IsNumberX-H)
Print("Result of the left side of the equation: {LeftSide}")
Print("Result of the Right side of the equation: {RightSide}")
how do I create a post to announce my problem?
hey Seedoh, thank you, This will be very useful in my studies!
Good luck with your studies!