Semi-circle-ish formula

Dois

New Member
Reaction score
1
Hi... Can anyone give me a formula I can use for something like...

JASS:
        loop
            set L2 = Location(GetLocationX(L1) + x, GetLocationY(L1) + y)
            call DestroyEffect(AddSpecialEffectLoc("Abilities\\Spells\\Human\\SpellSteal\\SpellStealTarget.mdl", L2))
            call RemoveLocation(L2)        
            exitwhen x == 300
            set x = x + 10
            set y = ?????
        endloop


A semi-circle that starts at X = -300 and ends at x = 0?

The sin curve would work too but I don't know how to change the "wavelength"

I mean like I need it to start at "X=-300" and end at "X=300" <<< for the sin curve... and "Absolute" as well... So itll form 2 semi-circles...

Edit: nvm i think ive figured it out
 
Circle:
x = Xcenter + radius * Cos(angle)
y = Ycenter + radius * Sin(angle),
where angle goes from 0 to 2PI.


The other way around:
Given the center and x as offset from there inside the circle:
y = Ycenter + SquareRoot(radius * radius - x * x)
or
y = Ycenter - SquareRoot(radius * radius - x * x), for the "other" side



No, I've no idea what you're trying here...
 
> Pow(Pow(150,2)-Pow(x+150,2),0.5)

= SquareRoot( 150 * 150 - (x + 150) * (x + 150) )

Hm... if (x + 150) * (x + 150) is larger then 150 * 150... you have a problem.
I.e. this only works if x is between -300 and 0.

Why do you add +150 to x?
 
oh

in the end it looks like this

JASS:
set x = -300
        set y = 0
        loop
            set L2 = Location(GetLocationX(L1) + x, GetLocationY(L1) + y)
            call DestroyEffect(AddSpecialEffectLoc(&quot;Abilities\\Spells\\Human\\SpellSteal\\SpellStealTarget.mdl&quot;, L2))
            call RemoveLocation(L2)        
            exitwhen x == 0
            set x = x + 10
            set y = SquareRoot(150*150-Pow(x+150,2))
        endloop
        loop
            set L2 = Location(GetLocationX(L1) + x, GetLocationY(L1) + y)
            call DestroyEffect(AddSpecialEffectLoc(&quot;Abilities\\Spells\\Human\\SpellSteal\\SpellStealTarget.mdl&quot;, L2))
            call RemoveLocation(L2)        
            exitwhen x == 300
            set x = x + 10
            set y = SquareRoot(150*150-Pow(x-150,2))
        endloop
        call TriggerSleepAction(0.2)


so it makes 2 semi circles...

one from -300 to 0 and another from 0 to 300


edit: this is actually the top of my heart that i was trying to make.... that heart equation was too... big... im not good enough to use that... so now i just have a triangle at the bottom and two semi circles at the top for a heart. the points dont connect right but.. oh well this is the best i can get so far...
 
JASS:
globals
    constant string HeartEffect = &quot;Abilities\\Spells\\Human\\SpellSteal\\SpellStealTarget.mdl&quot;
    constant real factor = 0.4  // size, sort of. don&#039;t go too big!
    constant real rad05 = 5.0 * bj_DEGTORAD
    constant real rad60 = 60.0 * bj_DEGTORAD
endglobals

function Trig_Heart_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local real f = (GetUnitFacing(u) - 90.0) * bj_DEGTORAD
    local real cf = Cos(f)
    local real sf = Sin(f)
    local real xc = GetUnitX(u)
    local real yc = GetUnitY(u)
    local real x
    local real y
    local real t
    local real a = 0.0
    local real b = 0.0

    loop
        set a = a + rad05
        set b = b + 5.0
        exitwhen b &gt; 60.0
        set t = 1200 + 40 * b - b * b
        set x = t * Sin(a) * factor
        set y = t * Cos(a) * factor
        call DestroyEffect(AddSpecialEffect(HeartEffect, xc + x * cf - y * sf, yc + x * sf + y * cf))
        call DestroyEffect(AddSpecialEffect(HeartEffect, xc - x * cf - y * sf, yc - x * sf + y * cf))
    endloop

    set u = null
endfunction

//===========================================================================
function InitTrig_Heart takes nothing returns nothing
    set gg_trg_Heart = CreateTrigger(  )
    call TriggerRegisterPlayerSelectionEventBJ( gg_trg_Heart, Player(0), true )
    call TriggerAddAction( gg_trg_Heart, function Trig_Heart_Actions )
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top