MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / world2canvas

Function world2canvas

polynomial-regression/index.js:23–25  ·  view source on GitHub ↗
(canvas, x, y)

Source from the content-addressed store, hash-verified

21const order = 3;
22// Convert world coordinates to canvas ones.
23function world2canvas(canvas, x, y) {
24 return [x + canvas.width / 2, -y + canvas.height / 2];
25}
26// Draw x and y axes in the canvas.
27function drawAxes(canvas) {
28 const ctx = canvas.getContext('2d');

Callers 3

drawAxesFunction · 0.85
drawXYDataFunction · 0.85
renderModelPredictionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected