Need trig & LCB help

hh hh at hyperhh.de
Tue Oct 29 11:30:34 EDT 2019


Replace the last part of your handler with the following.

variable tBNum as Number
variable tBCenters as List

put tBigRad - tLilRad into tInnerRad
put the number of elements in mData into tBNum
put regularPoints([tBNum,tInnerRad,tBigX,tBigY]) into tBCenters
repeat with tButtonNumber from 1 up to tBNum
   fill circle path centered at tBCenters[tButtonNumber] \
        with radius tLilRad on this canvas
end repeat

-- returns list of N regular (=evenly spaced) circle points 
-- starting at high noon, turning clockwise
-- pL = [numOfPoints,radius,centerX,centerY]
handler regularPoints (in pL as List) returns List
  variable tI as Number
  variable tPi as Number
  variable tPts as List
  put 2*pi/pL[1] into tPi
  put [] into tPts
  repeat with tI from 0 up to pL[1]-1
    push point \
    [pL[3]+pL[2]*sin(tI*tPi), pL[4]-pL[2]*cos(tI*tPi)] onto tPts
  end repeat
  return tPts
end polyPoints

[Untested, right out of my head, should work.]




More information about the use-livecode mailing list