March 2019
Intermediate to advanced
336 pages
9h 9m
English
The drawContour method of the DrawContour class calls the drawShape method on the shape instance, this is shown in the following code:
//DrawContour method drawContour given the coordinatesfunc (contour DrawContour) drawContour(x[5] float32,y[5] float32) { fmt.Println("Drawing Contour") contour.shape.drawShape(contour.x,contour.y)}//DrawContour method resizeByFactor given factorfunc (contour DrawContour) resizeByFactor(factor int) { contour.factor = factor}// main methodfunc main() {var x = [5]float32{1,2,3,4,5}var y = [5]float32{1,2,3,4,5}var contour IContour = DrawContour{x,y,DrawShape{},2}contour.drawContour(x,y) contour.resizeByFactor(2)}
Run the following commands:
go run bridge.go
The following screenshot displays ...
Read now
Unlock full access