All Questions
Tagged with sin or trigonometry
3,449 questions
0
votes
1
answer
104
views
Firefox tan(atan2(x, y)) workaround with different length units?
I have a pretty complicated trig function that I need to calculate dynamically. I'm trying to do it in CSS, but it requires a quotient of a value in CQW units with a value in CQH units, in a <div&...
0
votes
1
answer
120
views
SEGFAULT occuring in C in raycaster due to incorrect high values being input into map array [closed]
Using Dev C++ 5.4.1 I've been following this raycaster tutorial as a fun project for myself: https://youtu.be/gYRrGTC7GtA?list=PLAaI2BTdQ5UNqKyp-0qwGzsU7U2DmeQmA&t=557
At the point in the video ...
8
votes
2
answers
247
views
Compute sin(x)-x efficiently to double precision accuracy on range |x| <= pi
There is a trig related function missing from math.h, namely x-sin(x). I am trying to implement it accurate to full double precision for |x| <= pi. Minimum ripple polynomial or rational ...
3
votes
1
answer
203
views
Maxima's trigrat can transform a real-valued expression into a non-equivalent non-real-valued expression?
Is this a bug in Maxima's trigrat function, or am I using it incorrectly? Sometimes trigrat transforms a real-valued expression into a non-equivalent non-real expression:
Maxima 5.45.1 https://maxima....
-1
votes
1
answer
83
views
How do I scale and translate my Pentagons properly?
I am trying to finish a program that will take the world coordinates of polygons, in this case pentagons, and scale and translate them from a world size of 1280x720 so they are drawn based on the ...
1
vote
2
answers
141
views
polar plot -- sin transformation
I want to plot a very simple function that would look like a simple sinusoidal f(x) = r + n* sin(n*x) in a Cartesian coordinate plane.
Given this, now I want to plot this in a polar plot -- ideally as ...
1
vote
3
answers
242
views
How to change Math.atan2's zero axis to any given angle, while keeping it in the range of [-π, π]? [closed]
Question:
Is there a for-good, unconditional way to map the output of Math.atan2 to another range while keeping the result still in [-180°, 180°], as if the calculation does not start from the ...
2
votes
3
answers
387
views
Want to convert degrees to radians and have the answer output symbolically
I am using the Sympy library in Python, and I'm trying to convert degrees to radians, and have the output rendered symbolically. Sympy does not have a function for converting degrees to radians, but ...
1
vote
1
answer
124
views
Plot the response variable according to the time of day (i.e., sun time) after fitting a linear mixed-effect model with nlme R package
I have fitted a linear mixed-effect model in the R package nlme (which allowed me to include a corCAR1 structure). In this model, the distance travelled between two consecutive GPS animal locations (i....
7
votes
2
answers
862
views
Did I beat Remez in sine approximation?
First, it is the most compact sine approximation ever. It seems I can do better than Remez in terms of precision/performance. Here the [0,pi/2] approximation range.
double p[] =
-0....
2
votes
2
answers
115
views
Processing 3D Local Rotation
So I am trying to emulate a robotic arm in Processing, and have most of it working. The problem I'm having is that the last arm segment (excluding the pinchers) needs to rotate along it's own relative ...
0
votes
2
answers
99
views
How to evenly space slices on donut chart?
I'm unable to figure out how to evenly space each slice on this donut chart.
Screenshot of Donut Chart
import { storyblokEditable } from "@storyblok/react";
import { type BlokType } from &...
0
votes
1
answer
157
views
the cos function in cmath libray is not working correctry [duplicate]
i am using c++20 and cos() is not working correctly(visual studio)
#include <cmath>
#include <numbers>
//it is supposed to give me 0
std::cout << cos(std::numbers::pi / 2);
//it ...
0
votes
0
answers
41
views
Estimating Tag Position from Distance and Angle of Arrival Measurements with only Anchor Rotation
I'm working on a problem involving positioning in a 2D space and need some help understanding why my approach isn't always working.
I have:
An anchor located at the origin $(0, 0)$.
A tag at an ...
-3
votes
1
answer
75
views
Calculate the value of an angle in JavaScript [closed]
Im trying to make a code that calculates the value of an angle in a right angle triangle provided its sin, cos or tan. For example, in a calculator, if you have the value of sin(x) and you want to ...