Экспорт:
Папки
/446634661/yaziki-programmirovaniya/javascript/funkcii/trigonometriya
Не экспортировать закрытые директории
Преобразовывать заметки в html
Экспортировать
Применить |
![]() | ![]() |
| 2019-05-12 13:27:43 |
|
|
Новый текст
| 2019-04-24 10:09:50 |
|
|
function degrees_to_radians(degrees)
{
var pi = Math.PI;
return degrees * (pi/180);
}
function getXYByAngle(R, angel)
{
var result = [];
if(angel < 0)
{
var count_360 = Math.ceil(angel/360);
angel = angel - count_360*360;
}
else
if(angel > 360)
{
var count_360 = Math.ceil(angel/360) - 1;
angel = angel - count_360*360;
}
angel = 360 - angel + 90;
angel = degrees_to_radians(angel);
result.x = R * Math.cos(angel) * 1;
result.y = R * Math.sin(angel) * 1;
return result;
}
var test = getXYByAngle(1, 120);// Где 1 - радиус, 120 угол в градусах. Вычисления проводятся из расчета, что 0 градусов на севере (верх), а 90 на востоке (справа)
alert('x=' + test['x'].toFixed(2) + '/y=' + test['y'].toFixed(2));
| 2019-04-24 10:00:17 |
|
|
function radians_to_degrees(radians)
{
var pi = Math.PI;
return radians * (180/pi);
}| 2019-04-24 09:59:54 |
|
|
function degrees_to_radians(degrees)
{
var pi = Math.PI;
return degrees * (pi/180);
}





