I have a square canvas with a width of 100 and a height of 100. Inside this square, I draw an arc like this:
var canvas = document.getElementById('myCanvas'); var ctx = canvas.getContext('2d'); ctx.clearRect(0,0,100,100) // clears "myCanvas" which is 100pixels by 100 pixels ctx.beginPath(); ctx.arc( 50, 50, 30, 0, Math.PI*2/6 , false ) ctx.stroke();
The question arises: how to get the x / y coordinates of the first and last points of the drawn line relative to the upper left corner of the canvas?
(x + radius, y). - , (x + radius*cos(angle), y + radius*sin(angle)). , , angle . .
(x + radius, y)
(x + radius*cos(angle), y + radius*sin(angle))
angle
( , , anticlockwise , . anticlockwise , y. , , . , .)
anticlockwise
Source: https://habr.com/ru/post/1763876/More articles:What is the difference between explicit and implicit locking in a database? - database-lockingQT CSS Property Selectors - qtcross browser hides mouse cursor - javascriptASP.NET - FormView - Datasource updates only some of the fields - asp.netWPF popup: how to make a reusable pop-up template? - templatesOracle-SQL: looping, compound sequences - sqlWill half a million records with the same date value as the non-unique index in the column for that date? - performancecreating a powershell script to back up a file and add a date - powershellIs this the right way to import an Oracle dump database? - importhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1763881/nosql-for-saving-soap-requests-to-db-for-audit-logging-and-then-querying&usg=ALkJrhhtsam2z_n5l0vp_fEHuxvz22Q0NwAll Articles