This question is more about algebra than programming but maybe I will find some help here ðŸ™‚ I am trying to create a QRect around a QLine with given offset(see picture below). Having the segment AB and the offset, how to find all the missing points to create a QRect? Source: Windows Que..

#### Category : algebra

So I am trying to make a boids simulation. I am trying to implement the first rule which is that each boid must steer away from nearby boids. I have all boids in a std::vector called boids. Each boids has a std::vector called withinSensoryRange which holds all boids which are within the boids sensory range. ..

Background I am attempting to create a program that creates a fully simplified newton polynomial from a divided differences table. I already have all of the resources to do this, but I am confused on how to get my loops working. Concept Conceptually, I have pinpointed that I have a [50][51] floating point matrix that ..

First of all, I’m new to C++. Tbh I find it very hard to "get used to" but the last week I have been trying to "translate" a script from Python to C++ due to computational time requirements. One of the problem I have is root-finding of simple 1D functions: First the simple MWE from ..

I wanted to simplify algebraic expressions in c++. I started with something simple: removing brackets from a algebraic expression containing + and – operators. For example, a-(b-c) should be simplified to a-b+c. This link gives the answer to this question. Here is the source code: #include <iostream> #include <string.h> #include <stack> using namespace std; // ..

I would like to simplify basic algebraic expressions such as (x + 2y * (3x + 2)) / 5. Are there any libraries that exist in C++ that allow me to do so? Source: Windows Que..

I have this code for compressing data. First, I collect the last 3 on bits of a byte. Then I record the rest. Using a simple algorithm, I strip the differences of their lengths. This is seen in the code just below. int cx_lo_bits = (j > -1) ? j : -1; int cx_mid_bits = ..

I need function to fast compare root of quadratic function and a given value and function to fast compare two roots of two quadratic functions. I write first function bool isRootLessThanValue (bool sqrtDeltaSign, int a, int b, int c, int value) { bool ret; if(sqrtDeltaSign){ if(a < 0){ ret = (2*a*value + b < 0) ..

I’ve found an exercise in which I am supposed to calculate the factorial of all numbers in a vector. The exercise goes as follows. You are given "n" natural numbers. Calculate the product of their factorials modulo 1.000.000.007 Constraints are as follows: 1 <= n <= 1e+6 All the numbers/elements are less than 1e+7. I’ve ..

## Recent Comments