CurseForge Register Sign In

Authors CurseForge

  • Dashboard
  • Forums
  • Paste
  • Knowledge Base
  • Reward Store
Desktop View
  • Home
  • Member List
  • _ForgeUser25773850's Profile
  • Send Private Message
  • View _ForgeUser25773850's Profile
  • _ForgeUser25773850
  • Registered User
  • Member for 4 years and 7 months
    Last active Tue, Jun, 21 2016 12:38:20
  • 0 Followers
  • 5 Total Posts
  • 0 Thanks
  • Posts
  • Threads
  • Forum Posts
  • View _ForgeUser25773850's Profile

    0

    Jun 27, 2016
    _ForgeUser25773850 posted a message on Trapezoidal rule in Lua
    Thanks a lot :)
    Posted in: Lua Code Discussion
  • View _ForgeUser25773850's Profile

    0

    Jun 27, 2016
    _ForgeUser25773850 posted a message on Trapezoidal rule in Lua
    Hi guys,

    I would like to implement the trapezoidal rule in Lua.

    https://en.wikipedia.org/wiki/Trapezoidal_rule

    I am not sure how to sum up each calculation.

    My code:

    example = {1,3,5,7}
    pos_x = {0.0, 3.0, 6.0, 9.5}

    for i = 1, #example do
    if i + 1 > #example then
    return -- exit out
    end
    local time_var = pos_x[i+1] - pos_x[i]
    local value_var = example[i+1] + example[i]
    tra_rule = ((time_var) * value_var/2)
    print(tra_rule)
    end

    The calculation should be:

    (3.0 - 0.0) * ((3+1)/2) + (6.0 - 3.0) * ((5+3)/2) + (9.5 - 6.0) * ((7+5)/2)

    Do you guys have any idea ?

    Best,
    ecki891
    Posted in: Lua Code Discussion
  • View _ForgeUser25773850's Profile

    0

    Jun 21, 2016
    _ForgeUser25773850 posted a message on Array problem in Lua
    Thanks @myrroddin :)
    Posted in: Lua Code Discussion
  • View _ForgeUser25773850's Profile

    0

    Jun 21, 2016
    _ForgeUser25773850 posted a message on Array problem in Lua
    Thanks a lot !!!

    Great job :)

    Best,
    ecki891
    Posted in: Lua Code Discussion
  • View _ForgeUser25773850's Profile

    0

    Jun 21, 2016
    _ForgeUser25773850 posted a message on Array problem in Lua
    Hi guys,

    I am trying to multiply each element of an array list by its neighbor. I've tried to use a while loop to solve that issue.

    As an example:
    array_list = {1,3,5,7}

    The result should be:
    1 * 3 = 3
    3 * 5 = 15
    5 * 7 = 35

    Code:

    array_list = {1,3,5,7}

    while array_list[i] do
    if i <= table.getn(array_list) and i<=i+1 then
    test_var = array_list[i] * array_list[i+1]
    --term = math.sqrt(test_var)
    end
    end

    print("Test var:" , test_var)


    Do you have any suggestion ?

    Best,
    ecki891
    Posted in: Lua Code Discussion
  • To post a comment, please login or register a new account.
  • Product
    • Overwolf platform
    • Appstore
    • Download Overwolf
  • Developers
    • Getting started
    • Documentation
    • Apply for funding
  • Partners
    • Advertise on Overwolf
    • Partner with us
    • Influencers
  • Company
    • About us
    • Our story
    • Commitment to gamers
    • Blog
    • Career
  • Resources
    • Help & support
    • Terms of service
    • Privacy policy
    • Brand guidelines