3,449 questions
Advice
0
votes
7
replies
97
views
I found two solutions on how to generate points on a circle, within two radius values. One solutions favors the center, one does not. Why is this so?
There was a Reddit post about generating points randomly in a circle, where the points are constrained between two radius bounds, minRadius and maxRadius. The formula to generate a point from an ...
0
votes
1
answer
137
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
136
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
270
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
209
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
85
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
148
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
252
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
404
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
130
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
884
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
118
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
106
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
160
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
44
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 ...