A
A
Artyom2018-09-11 10:14:09
Canvas
Artyom, 2018-09-11 10:14:09

How to draw along normal axes in canvas or svg?

How to draw on normal axes in canvas and svg?
Those. not by these:
5b976a72a15a9954532548.png
But by such:
5b976aa94242b511014967.jpeg
I need to draw a figure over the coordinates inserted through the axes, but because
the Y axis goes in html from top to bottom, then naturally it turns out not right.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dom1n1k, 2018-09-11
@danyvasnafig

1. Take the Y coordinate with a minus
2. Multiply both axes by the desired scale factor
3. Add the coordinates of the origin to both coordinates (triple tautology)

V
Vladimir Proskurin, 2018-09-11
@Vlad_IT HTML tag curator

Well, choose zero coordinates, for example 100:100, then just invert the ordinate
x = 100 + x1;
y=100 - y1;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question