MCPcopy
hub / github.com/fogleman/primitive / NewRandomRotatedRectangle

Function NewRandomRotatedRectangle

primitive/rectangle.go:87–97  ·  view source on GitHub ↗
(worker *Worker)

Source from the content-addressed store, hash-verified

85}
86
87func NewRandomRotatedRectangle(worker *Worker) *RotatedRectangle {
88 rnd := worker.Rnd
89 x := rnd.Intn(worker.W)
90 y := rnd.Intn(worker.H)
91 sx := rnd.Intn(32) + 1
92 sy := rnd.Intn(32) + 1
93 a := rnd.Intn(360)
94 r := &RotatedRectangle{worker, x, y, sx, sy, a}
95 r.Mutate()
96 return r
97}
98
99func (r *RotatedRectangle) Draw(dc *gg.Context, scale float64) {
100 sx, sy := float64(r.Sx), float64(r.Sy)

Callers 1

RandomStateMethod · 0.85

Calls 1

MutateMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…