Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
6 replies
118 views

If we round a negative number to the nearest integer in JavaScript, in the case of a tie (i.e., a fractional part of 0.5), the nearest integer is the one closer to positive infinity. For example: Math....
4ou4's user avatar
  • 1
1 vote
2 answers
83 views

I was working on Leetocde 108: Convert Sorted Array to Binary Search Tree. The input is a sorted array of integers, and the goal is to return a height-balanced binary search tree (BST), meaning that ...
MWu's user avatar
  • 11
0 votes
1 answer
114 views

I have this Wavy Stamp Shape struct WavyPostageStampShape: Shape { var amplitude: CGFloat = 8 var wavesX: Int = 6 var wavesY: Int = 10 var phase: CGFloat = 0 var step: CGFloat = 2 ...
Codelaby's user avatar
  • 3,162
Tooling
1 vote
2 replies
138 views

I’m working on calculating the area of irregular shapes (such as polygons with uneven or non-parallel sides) in code. I understand how to calculate areas for regular shapes, but I’m unsure what the ...
M Sissique's user avatar
Advice
1 vote
9 replies
76 views

I'm working on a small Python prototype to model basic Euclidean geometry objects (lines, rays, points). I've intentionally stripped it down to a minimal example to highlight a design issue I'm ...
Jasper's user avatar
  • 101
-1 votes
2 answers
67 views

I don't know how to script or add scripts in Google sheets android When something is pressed, check of cell contains a number AND is NOT empty. add +1 to cell. Allow this to happen to multiple cells ...
TCG248's user avatar
  • 1
1 vote
2 answers
203 views

So I know from physics that position at a given time can be calculated using its derivatives like this: Now I know this looks awfully similar to Taylor series: In fact they are exactly the same. ...
Ξένη Γήινος's user avatar
Best practices
2 votes
3 replies
90 views

I would prefer to do this without having to calculate every previous row of Pascal's triangle first. I'm familiar with the algorithm for calculating the nth row of Pascal's triangle directly, where ...
little dutch boy's user avatar
1 vote
3 answers
238 views

I have decided to implement code to generate tangent numbers as a self-imposed programming challenge. I have succeeded in doing so, but not as efficient as I want it to be. What are tangent numbers? ...
Ξένη Γήινος's user avatar
Advice
1 vote
5 replies
92 views

I'm currently using Unity (and C#) in a direction comparison system I'm currently making. For a cut down example, these are some directions I have: {Up, {0,1,0}}, {UpRight, {1,1,0}}, {UpRightForward, {...
Lord Flumph's user avatar
Best practices
0 votes
3 replies
41 views

I’m working on an underwater acoustics project (student project) analyzing the sound of breaking waves. When a wave breaks, bubbles are entrained and their oscillations generate broadband underwater ...
Ruben Lott's user avatar
Best practices
0 votes
2 replies
85 views

I am trying to build function for calculator this is my code : ExpressionParser p = GrammarParser(); Expression exp = p.parse(input); var evaluator = ...
dr mhmd's user avatar
Advice
1 vote
2 replies
70 views

I'm developing the math engine for a high-volatility cascading slot game (similar to Megaways mechanics). As part of our global compliance and certification process, we need to run Monte Carlo ...
Elliot Branson's user avatar
Advice
2 votes
11 replies
94 views

I am trying to build a Python algorithm that can transitively propagate inequalities between objects. For example, if I know that A < B and B < C, I want the system to automatically infer that A ...
Jasper's user avatar
  • 101
3 votes
0 answers
155 views

I know, this should be easy to solve, but I have been struggling with it for a few days and have not been able to find the problem. I have given two poses of the same object in two different ...
Alex's user avatar
  • 41
0 votes
3 answers
175 views

My context I have implemented an equals(Object o) method for a speed object (Vitesse here) that when it faces a comparand being in m/s when it is itself in km/h (in example) puts the comparand in km/h ...
Marc Le Bihan's user avatar
0 votes
1 answer
159 views

I am making a drawing application and i have to show the borders of the pencil. To know where to place the pixels I use a list of integer offsets from the cursor that make up a shape, so the cursor is ...
Gabbinetto's user avatar
0 votes
2 answers
84 views

I want to get rid of transforms in my SVG, for more simplicity in dealing with my already complex shapes and code. I manipulate the inline SVG dynamically on my web site in PHP. Transforms has four ...
Dikkie Dik's user avatar
Advice
0 votes
5 replies
104 views

As the title says, how can i convert a value that i have from a longitude or latitude from degrees to meters ? The task is basically to calculate MAE errors for x,y,z of trajectory prediction, MAE Z ...
Destr's user avatar
  • 1
Advice
2 votes
10 replies
71 views

I have a 3d scan of a metal pipe and I can slice it at different heights. When looking at a cross-section of a new pipe, the data should match the shape of a perfect circle, but due to erosion the ...
G-Man's user avatar
  • 1
1 vote
1 answer
187 views

I'll be questioning about a drawing program - flash 8 and how its brush worked. The question is about math, bezier curves, vectors, algoritms, geometry. i'm trying to recreate how Flash 8's brush tool ...
xXxAirSnifferxXx's user avatar
-2 votes
1 answer
306 views

I was writing an implementation of the Knuth up-arrow notation, and I realized I had a problem. To make it work, I would have to iteratively stack more and more references to a function containing my &...
lhyperviolet's user avatar
6 votes
1 answer
786 views

I am drawing some 2D renders, and I tried to render the cosine of the distance as a color. What I expected was some concentric circles with the color oscillating once, but this does not do that. ...
drok's user avatar
  • 118
5 votes
2 answers
162 views

I have a list of elements like [1, 1, 2, 2, 3, 4, 5]. I want to iterate through all the k-length sub-lists of this list, such that identical combinations do not occur, that is I don't get [1, 3, 4] ...
Ibolit's user avatar
  • 9,850
Advice
0 votes
7 replies
152 views

There are many Stack Overflow questions about fast logarithm calculation, but all of them presuppose that you want to calculate a logarithm using a specific base. Two, e, and 10 are popular bases. I ...
John Ladasky's user avatar
  • 1,093
0 votes
2 answers
88 views

I’m writing a Selenium script to auto-fill a contact form, like this one, and yeah, obviously the main site is different — cornerstonesalina.com/elements/contact-form/, there’s a math captcha like &...
Dima's user avatar
  • 9
0 votes
1 answer
99 views

I am trying to use an Excel Formula to calculate the cost using the height and width of glass in millimeters, dividing the result by 1000 and then multiplying it by the minimum square meter cost value ...
Mark AES's user avatar
Advice
0 votes
3 replies
155 views

I have one worksheet with a few columns: Product name part name order of part in product Volume A Volume B Difference vol A and B Dif % One part can be used for many products. All products are ...
Hubert S's user avatar
0 votes
1 answer
135 views

I have one table(final Table) which has columns (date, volume, Month, resource) where I'm calculating the utilization of a resource. so,I need to have time which gets calculated as per below formula ...
Drashti's user avatar
  • 13
2 votes
1 answer
100 views

So I'm trying to generate a map for a personal project using opensimplex noise, multiple layers etc. My problem is that I want to recreate the equator to combine with a temperature map to obviously ...
tygzy's user avatar
  • 748
3 votes
2 answers
269 views

I write a cross-platform program for Windows and Linux, and I would like it to behave as similar on both platforms as possible. I use some mathematics in the program, e.g. std::atan2 function calls, ...
Fedor's user avatar
  • 25.7k
2 votes
1 answer
146 views

I'm in the process of writing some mathematical operations. Here's a sample program to give you an idea of what kind of thing I could be doing: from dataclasses import dataclass import random @...
Ivan's user avatar
  • 645
Advice
1 vote
2 replies
117 views

There is a progress indicator with 100 steps. However, the total number of items being processed is much too large; it doesn't fit in a register. Thus, the simple way of V = (P * 100) / T is ...
Joshua's user avatar
  • 43.7k
Advice
2 votes
3 replies
135 views

I have an embedded device that implements an unknown 32-bit CRC-based checksum algorithm in hardware. I can use this device as an oracle to generate checksum values from arbitrary input, and verify ...
perniciousquery's user avatar
Best practices
3 votes
6 replies
154 views

I am working on a multiplication routine in a big integer library in POSIX C99 with a signature of bigint_st *bigint_mul(bigint_st *dest, const bigint_st *a, const bigint_st *b). Many of the routines ...
Eric Pruitt's user avatar
  • 1,903
Advice
0 votes
4 replies
66 views

I want a simple hashing algorithm with the following conditions: 1,) if n is a ten-digit integer, eg, 1234567890, then the hash of n will equal the hash of all (left-justified) sub-strings of n. As in,...
EternalPropagation's user avatar
4 votes
1 answer
283 views

The inverse of the gamma function over the reals is multivalued with an infinite number of branches. This self-answered question is about the principal inverse of the gamma function, Γ0-1(x), whose ...
njuffa's user avatar
  • 27.4k
Advice
0 votes
1 replies
99 views

I was working on this elliptic curve equation: y^2 = x^3 - 228n*x - (432n^6 - 1368n^3 - 361) and using SageMath, I have been able to develop rational points for the cases n = 1, 3 and 4. For the case ...
Agbanwa Jamal's user avatar
Advice
0 votes
13 replies
6k views

I'm wondering how the truncate function works. C++ is just an example i'm using because it's a language I know. I've searched online and I can't seem to find how it works, simply how to use it and ...
nugget's user avatar
  • 70
Advice
0 votes
1 replies
301 views

I was asking ChatGPT about how to take a custom-designed monospaced font, and specifically how to make the "stretchy math glyphs/constructs" (parentheses, brackets, braces, integrals, ...
Lance Pollard's user avatar
Advice
1 vote
9 replies
136 views

I have a binary tree which leafs have a size of 1, and the parent double in size at each level. I project those nodes on a linear axe (memory space). I need to get the equation that gives the adress ...
Simon's user avatar
  • 2,145
10 votes
3 answers
643 views

Consider an array of a permutation P of length n (n > 2), namely some order of the integers 1 through n. Example of P with length n = 7, [6,5,2,3,7,1,4] A "score" of a permutation is ...
user31824378's user avatar
-3 votes
1 answer
72 views

I use a learning management system from my coaching classes, and due to copyrighted material, I can't share screenshots here. However, I'm attempting to convert typed math to Latex/Mathjax math ...
chickfeet08's user avatar
0 votes
2 answers
124 views

I have a problem on how to calculate "partial" percentages that match the "total" percentage. My problem is as in the table below. I have values for the beginning and end of the ...
Jaol's user avatar
  • 391
1 vote
0 answers
94 views

I have a QEF implementation like this float atA[3][3] = { 0 }; FVector atb = FVector::ZeroVector; for (const FEdgeIntersection& e : IntersectionList) { const FVector& n = e.Normal; ...
ma1169's user avatar
  • 1,277
1 vote
2 answers
125 views

I know I can create a clean grayscale fog effect by applying an <feColorMatrix> effect to the output of an <feTurbulence> effect in order to isolate the Alpha channel: <?xml version="1....
Lawton's user avatar
  • 271
2 votes
0 answers
70 views

I'm computing PDE residuals for The_Well datasets (e.g. turbulent_radiative_layer_2D and shear_flow) using finite differences, but the residuals are much larger than I expect. The data are generated ...
Kain's user avatar
  • 21
-2 votes
1 answer
116 views

I have a Set of 2D points that I want to create a set of areas from, similar to a Voronoi Diagram. The difference is that I would like these areas to be blended, like in the following image. I wouldn'...
CptHavvock's user avatar
1 vote
3 answers
264 views

I am currently writing a program in C to convert numbers between bases as an exercise. It asks the user for an input and for the base, that the number given is. It then gives the input into the ...
Brentspine's user avatar
  • 1,257
14 votes
4 answers
2k views

My code reliably finds a precise (similar value every time) but in the region of 3.24 and 3.26. Competent mathematicians will note this around 0.1 away from an ideal Pi value. My code revolves around ...
Sam Wray-Twell's user avatar

1
2 3 4 5
922