D
D
Dima Pautov2017-06-07 23:25:47
JavaScript
Dima Pautov, 2017-06-07 23:25:47

How to calculate the coordinate at the center of the path element?

Good night guys! With the help of svg.js I draw path.
I need to find out the coordinate at the center of this element, not knowing its dimensions, but knowing the start coordinate of the line from the top left and the end coordinate of the line from the top left.
A small example of how to build a line for me:

// Откуда построить линию
var where = {
  top: 100,
  left: 100
};

// Куда построить линию
var from = {
  top: 350,
  left: 450
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Penshin, 2017-06-08
@bootd

midpoint

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question