Paste #63945: Circle Procedure

Date: 2020/01/11 17:56:27 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


CircleProc:
    type: procedure
    debug: false
    definitions: location|radius|density|stretch|loops
    ##EX <player.location> 3 100 0 1
    ##Returns a list of points around a specified location in a circle
    script:
        - define 2pi <util.pi.mul[<element[2].mul[<[loops]||1>]>]>
        - define particle_locations li@
        - define radius_location <location[<[radius]>,0,0]>
        - repeat <[density]>:
            - define stretchmax <[stretch].div[<[density]>].mul[<[value]>]>
            - define point_location <[radius_location].rotate_around_y[<[2pi].div[<[density]>].mul[<[value]>]>].with_y[<[stretchmax]>]>
            - define particle_locations <[particle_locations].include[<[location].add[<[point_location]>]>]>
        - determine <[particle_locations]>