# How to do parabola with verse?

**URL:** <https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720>\
**Category:** Verse\
**Tags:** math, unreal-editor-for-fortnite, fortnite\
**Created:** [October 11, 2023, 7:59pm UTC](https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720 "2023-10-11T19:59:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![VETZBR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vetzbr/32/892910_2.png) [@VETZBR](https://forums.unrealengine.com/u/VETZBR)\
**Post date:** [October 11, 2023, 7:59pm UTC](https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720/1 "2023-10-11T19:59:24Z")

</div>

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! 🙂

---

<div class="post-metadata">

**Author:** ![SeedohFN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seedohfn/32/720959_2.png) [@SeedohFN](https://forums.unrealengine.com/u/SeedohFN)\
**Post date:** [October 12, 2023, 6:39pm UTC](https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720/2 "2023-10-12T18:39:00Z")

</div>

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

```auto
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}")

```

 ![Screenshot 2023-10-12 213233](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/2/b/82b86bc32d1e5d6b1bd7d1b84ddbcd9474f3cc55.jpeg)

---

<div class="post-metadata">

**Author:** ![Q3tum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Q3tum](https://forums.unrealengine.com/u/Q3tum)\
**Post date:** [October 12, 2023, 7:30pm UTC](https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720/3 "2023-10-12T19:30:27Z")

</div>

how do I create a post to announce my problem?

---

<div class="post-metadata">

**Author:** ![VETZBR](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vetzbr/32/892910_2.png) [@VETZBR](https://forums.unrealengine.com/u/VETZBR)\
**Post date:** [October 13, 2023, 4:17am UTC](https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720/4 "2023-10-13T04:17:40Z")

</div>

hey Seedoh, thank you, This will be very useful in my studies!

---

<div class="post-metadata">

**Author:** ![SeedohFN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/seedohfn/32/720959_2.png) [@SeedohFN](https://forums.unrealengine.com/u/SeedohFN)\
**Post date:** [October 13, 2023, 8:02am UTC](https://forums.unrealengine.com/t/how-to-do-parabola-with-verse/1329720/5 "2023-10-13T08:02:54Z")

</div>

Good luck with your studies!
