type Solution struct { r float64 x float64 y float64 } func Constructor(radius float64, x_center float64, y_center float64) Solution { return Solution{ r: radius, x: x_center, y: y_center, } } func (this *Solution) RandPoint() []float64 { phi := rand.Float64() * 2.0 * math.Pi radius := math.Sqrt(rand.Float64()) * this.r // !!! dx, dy := radius*math.Cos(phi), radius*math.Sin(phi) return []float64{this.x + dx, this.y + dy} } /** * Your Solution object will be instantiated and called as such: * obj := Constructor(radius, x_center, y_center); * param_1 := obj.RandPoint(); */