I have parallelogram points A,B,C,D. How can i calculate the angle of 90 degrees knowing only these points. My functions is as follows: void RotateRight() { int h = northEast.y – southWest.y; int p = southEast.x – northWest.x; int q = southWest.x + northEast.x; } Dont know what to do next. Any help appreciated. I ..

#### Category : math

Hey guys any help would be appreciated: Doing a Code wars problem to find a prime number given an integer value. It seems my program is working properly but for some reason, it fails the prime number test. There seem to be some outlier numbers that cause it to fail but I can’t find it ..

#include <iostream> #include <math.h> #include <stdio.h> using namespace std; int main() { char x ; double c, f{}; cout << "welcome" << endl ; cout << "press C for celcius to far, press F for opposite direction."; cin >> x ; if (x == ‘C’) { cout << "enter a value…"; cin >> c ; ..

I am currently a beginner in coding with C++ and as I am starting I would like to trend my path towards mathematics and cryptography. I am currently studying abstract algebra and mathematics for cryptography and would like to be able to take what I’ve learned and put it into code. For example, I’d like ..

How can I traverse a 3-D matrix in spiral way, if I have to start from any of the edge planes? I was facing issue was this problem: https://www.codechef.com/UCS32021/problems/DSMID002 Source: Windows Que..

My assignment is to make use of while loop in a following task: to print the inputted integers into separate lines. Given instructions: 1. Create a variable and input a random positive integer. 2. Using while loop, print out each digit of the inputted integer in separate lines, starting from its rightmost digit until the ..

enter image description here This is my implementation of the given expression, is it correct ? #include <iostream> #include <cmath> using namespace std; double mathExpression(double a, double b, double x, double k ) { return 2 * a * pow(x, k) * exp(-3 * (a * b + log(2) * x)) – 3 * sqrt(pow(abs(a ..

I need to implement an arbitrary rank tensor (the number of dimensions is entered by the user). How do I iterate if I don’t know the rank of the tensor in advance? For example, to implement tensor transposition, only nested "for" loops come to mind, but this cannot be done without knowing the number of ..

This is the the code I wrote in C++ for getting 100!. I used double cause 100! is big and can’t be fitted in int and long long int. but the output is different with the 100! answer and I couldn’t find any problem in it. int main() { double a=1; for(int i = 2;i ..

So to clarify the situation, I have a server for a video game in C++ and the world is made up of chunks of procedurally generated landmass. The landmass is just a normal mesh made up of triangles, then I have a player walking around on the mesh, I have figured out which triangle (or ..

## Recent Comments