# Math Questions

## Calculate sine curve in C

I want to get a periodic value that moves between 0 and a specified height (in my case that's 40) from the sine curve. but i am messing

## What is the most efficient (speed) way to get a digit from a larger number?

I plan to use this inside a game loop to draw the score using custom bitmap font. here is what i have. now i know that i have used the

## Solving code-forces "1A Theatre Square" in C

Novice programmer here trying to get better at c, so i began doing code problems on a website called codeforces. however i seem to be stuck, i

## Algorithm to find a common multiplier to convert decimal numbers to whole numbers

I have an array of numbers that potentially have up to 8 decimal places and i need to find the smallest common number i can multiply them by so

## Unity aircraft physics

I want to make a simple aircraft controller, what looks like little realistic in unity. i watch some video from airplane physics. and make a

## Determining the position/direction of an aircraft

I'm working in a project that involves gyroscopes... i'm using arduino and an itg 3200 to read the data from the gyroscope. i get 3 values

## How to find common prime factors of two given numbers in C?

i am trying to solve this problem: input: the first line contains an integer t which represents the total cases you need to

## What is the motivation behind Pearson's coeficient in Apache Mahout

This question is with respect to the recommendation part of apache mahout using pearson's coefficient for measuring similarity between users.

I'm not so good with js and for some reason when i try to add two fields together it joins them rather than adding the sum together.. this is the

Make a new as3 document in flash, paste in the following code and run it: var

## What are the core mathematical concepts a good developer should know?

Since graduating from a very small school in 2006 with a badly shaped & outdated program (i'm a foreigner & didn't know any better school

## multiplication chains that result in a constant modulo a power of 2

Is there a practical algorithm that gives "multiplication chains" to clarify, the goal is to produce a multiplication change of an

## Problem with power operator for specific values

I am trying to do a simple function to check the differences between factorial and stirling's approximation: using dataframes n =

## Java Calculator program issue

I am trying to develop a calculator program that inputs an arithmetic expression of the form "number operator number =" and computes the

## decimal number as input, but turn the fraction and output as decimal js

I need a function with a decimal number as input (parameter). the function should turn the fraction of the number and output it as decimal

## Algorithm for integer solutions of a circle?

I am trying to search for integer solutions to the equation: y^2 + x^2 = 2n^2 if i search this in wolfram alpha,

## How can I optimize this in order to make it run in less time?

I have written a program which takes in argument an n value and generates n points with random coordinates between 0 and 1. these points are then

## Decrement/Subtraction of number in string in EJS

I have this line in ejs file: <%= nominations[i].month %> i want to decrement it in the ejs by 1. so i

## Approximately classify lines on image as vertical or horizontal

Suppose i have a list of coordinates for lines extracted with cv2.houghlinesp from edge mask obtained from

## Plotting multiple functions with pyplot, passing functions into functions, & reusing code

Import matplotlib.pyplot as plt x_coords = [] y_coords = [] def myfunction(x): return (3*(x**2)) + (6*x) + 9 def

## Python route finder for aviation

I made an app that besides all other things try to find a valid route between 2 airports. i have all the required data in a sqlite3 database witch

## I need to subtract from the input

I need to subtract 60 from the input before it divdes the bottom 3 lines in my code. thanks i don't know much about coding i have

## Create a combination method recursively

I am trying to implement a combination method using recursion. i have already done it using a for loop but want to approach it via recursion.

## How can I determine that which rectangles has max overlap with given rectangle?

I'm working on finding maximum overlap rectangle. i've tried using following lines of code but it returns with that rectangle is

## Convert GPS Coordinates to Match Custom 2d outdoor layout Image

I don't know if this is possible, but i am trying to take the image of a custom outdoor football field layout and have the players'

## Count the number of subarrays where the selected element is the largest value

We have an array of integers x. the task is to return an array y of the same size, where the ith element in

## trying to translate a math formula into python

I'm rather new to python i'm writing this program that calculates the falling time of a box using this simple formula: h-0.5gt^2 = 0

## How to mirror path in flutter?

So i have a code that paints path at container. void paintwithpattern( canvas canvas, double x, double y, double width,

## How do you use an if statement to extract a value from a select tag? (Javascript)

My first input box <input type="number" id="number1"> <br> <br> my options

## Do browsers support a fraction for a number input box when multiplying two numbers?

<input type="number" id="num1"> <input type="number" id="num2"> <button onclick="multnum">multiply</button> <p

## 'plus' or 'x' shaped wave in threejs

I have this scene made with three.js. (see code snippet attached in the post) or

## Determine which subset of points follows a polynomial most closely

I am currently trying to classify a bunch of rivers in regard to their behavior. many of the rivers have a behavior that is very similar to a

## Flutter canvas. How to get a ray through two points, and calculate the position through the x or y coordinates of the other point

I use canvas to draw. a, b, c is on the same line. there's two points and a x/y axis value of pointc:

## get the equation of a curve in javascript given a set of x and y coordinates

I have created this graph that simply shows the number of deaths against the

## Why does this numeric equation using a cosine produce a different result between a console application and windows application?

I write a mathematical function to be benchmark function in my optimization algorithm. public static double

## Making a square spiral

I am trying to make a square spiral. here is a python code: import matplotlib.pyplot as plt g = 5 #step w = 0 #width of

## Maintaining proportionality of sum constrained row when changing a single row value

I have a dataset that consists of compositional data. each column represents the percentage (decimal value) of a component in the mixture whole.

## Accurate cumulative sum for floats in Python 3

Given a list of floats in python, what is the most accurate way to produce the accumulated sums of that list? by accurate i mean

## From plain text to TEX - Javascript

I'm building a math application and i want to show math formulas written with a good design in javascript (nodejs). so i would transorm plain text

## How to write (+/-) in Python?

I'm new to python and i have below this formula and i faced (+/-) before the square root. how could i write it in python?

## How do I insert additional criteria to my existing statistics algorithm?

The problem i am writing a web app that will predict the winner of a baseball game. the user will select two teams, and based upon

## multiplication Table in dart

[1][i write a simple program in dart to print multiplication table but the output was not i

## Draw a parallel line with specific distance to already skewed line in canvas android

I have a line(,) on canvas even it may be skewed, all i want to do is , to draw a new parallel line with respect to old line(,) with equal line

## 360 Degree PNG Sequence Drag

I have a png sequence of 360 images (1 image per degree of rotation). i currently have a react component that renders the current degree of

## is it possible to round the last 3 digits of a number in c?

I would like to round the last 3 digits of the float number 169786.122 and leaving only 3 digits is it possible to do it with

## Progress Bar for Leveling System

So this is kind of 2 questions in one, but basically i'm making a ranking/leveling system for my discord bot (discord.js) and i'm having problems

## How to create multiple objectives iteratively in Pyomo AbstractModel?

I am trying to implement an abstractmodel that looks to optimise iteratively multiple objective functions over the same feasible set.

## How to get the decimal places of a number in Flutter/Dart

I wondered if there is a function to provide clean solution to getting the amount of decimal places or checking if a number has decimal places in

## Given a vector, a, how can I scale another unit vector so that it meets with the line that is perpendicular to vector a?

I understand how to do this using right triangles: the length of my desired vector will be the magnitude of vector a divided by the

## Math function for hours in a month

Is there a math function to calculate hours in a month excluding weekends? lets say i get the days in a month with momentjs.

## Getting All Combinations or Permutations of a Character using terms

I want all combinations words of character using terms. example : word = 'aan' result = ['ana', 'naa',

## How to do a calculation using a variable

I want to do a random calculation generator who give the answer. my problem is that i can't do the calculation. operating =

## Convert a value as a result of google colab which has e to a real value?

I have something like 3.34985746e-06 as a result of a calculation in colab. how can i convert this to a more readable value?

I am trying to use selenium get asynchronous elements(mathjax equation) loading time. i try to write a python-selenium script to record

## How do I access children data in JSON response using Javascript/GAS

I am trying to access children data from a json response to use it in an if statement but i don't know-how. anyone know how to do

## GAS/ Javascript giving wrong figures when summing up numbers

My javascript/gas code uses the user id to call for time entries via api for a specific date range (1 week) and sum up the hours. these time

## Draw small symmetrical arc line path between two markers on world map in Highmaps

I'm using highmaps to create a flight path chart, using their demo

## How to make text transition by animation upon button press?

Currently, when opacity = 0 & button is pressed, opacity becomes one. but i would like the button also having the function to turn opacity to

## How do I correct for errors in smoothing plotted data? (final data point is shifted)

The final data point is shifted compared to the rest of the graph, included is a reference plot in green with no smoothing showing the intended

## How to load MathJax in React?

I wrote an app using html which can render mathjax from script tag. now i moved to react but the mathjax equation is not rendering at all.

## ImportError: cannot import name 'RGBColor'

I am trying to import this: from colormath.color_objects import rgbcolor and i am getting this error:

## Problem with calculating line intersections

I am trying to display the points of intersecting lines, but the calculated points are between the actual intersectings.

## Python, mathematic operations on variables

In python 3 i was wondering if there was a way to get a variable from an input like this: x = input("-> ")

## Fibronacci sequence spitting wrong number

I have created a function that sumbs up all odd fibronacci numbers up to a given number, and for the most part it works all for except one number.

## How to simplify sympy vectors?

I am doing some symbolic vector calculations using sympy, but i can't simplify the arguments of the vector class in a proper way.

## How to create a unit vector of AB towards a number of degrees and calculate the angle between them?

Here you can see the vector ab. goal: make vector ac to find out α problem: to find out the angle α i would first need a second

## Does Fit.Line use least squares

The method fit.line - what algorithm does it use to

## Calculate Percentage XP Completed out of 100

Well i have seen many questions for calculating percentage, but i have my different case i have a table which says: id |

## Distribute items around circle with math - Flutter code

I have a set of elements and i need to distribute them on a circular curve like the one in the picture below, so that the maximum possible number

## How to handle multiple mathquill elements in single page

I need to handle multiple mathquill input boxes at the same time in single page application. i didnt able to found any implementation of this

## Resampling an array by duplicating or skipping items (translate numpy to js)

I am trying to translate this python/numpy code i have into javascript. this method takes an array and a target size and resizes the array by

## Excel: Count sum of cells along a row until a value is found

Picture 50 rows that all have a number "4" in it. however in each row there are 26 columns (a-z) and the 4 is placed on a different

## How to write a code to print the maximum of entered values?

I am writing a code to print sum, average, maximum and minimum. i could not figure out how to print the maximum this is the code. it should only

## How to display with MathJax using AsciiMath?

I'm using mathjax to display math formulas in my website. and now, i want to use asciimath too. the problem is,

## Regression with additional variables to optimize

I am given data which consists of x and y points (x_1,...x_n; y1,...y_n). i want to fit x to y using two basis functions:

## JS: Return a number to a specified power of 10

I'm working on a problem that requires me to return a number rounded to a specified power of 10. for example: 1234, specified

## Vector2List not working as expected : Dart // Flutter

I'm working on a game and using vector2list to represent the positions of many particles. let's say i want to increase the x value by 4.

## How to find out the nearest Whole number to a decimal after multiplying it with powers of 10

I have a float number 7.999999985666533 which is nearest to 8 and i have used it using math.isclose

## I get NaN error when trying to create a basic calculator

I'm 3 days into learning javascript and im really excited to understand more of this language, before i started i've done a basic html & css

## How can I count numbers in the given range?

So i wrote a code which lists all the numbers that are not divisible by 2 and 3. now i would like to know how many of those numbers are in rage

## Value domain error when calculating distance using specific longitude and latitude

So i used the distance function found on

## Determine 3D Longitude and Latitude based on radius, x and y 3D globe THREE.js

Currently i am trying to understand a codpen where this guy has json data being fed into a javascript app that plots coordinates using x and

## sum a state and event value

I want to add a state and an event input value. this is like state = 2, input value = 1, the result i expect it is 3. but the result is not what i

## How to Convert Number into Signs (Math) in Python

I am trying to make math quiz that asking with two random numbers (1, 10) with randomly choice with sum, difference or product. i used z =

## How to draw random points inside an ellipse?

I want to fill this ellipse with count random points inside it any help i'd be glad. what algorithm of actions?

## Fast algorithm for log gamma function

I am trying to write a fast algorithm to compute the log

## Percent function in java

I am a 11 year old app programer and i am making a calculator app. i want to add a percent button, so the user can find percantage, but when i

## Get radius from a circle to screen corners

I followed an online tutorial, i did not understand how the professor managed to get the distance of a circle from the top left corner of the

## Tensorflow dilation behave differently than morphological dilation

As the following piece of code shows, the tensorflow

## How to figure out the bounding box of a rotated trapezoid using the rotation

I'm trying to connect two rectangular object together which both have one corner cut off. after that operation they are practically

## How to determine the fewest number of Y increments needed to plot a multiple of 5 on a graph?

Using javascript, an array of numbers is going to be charted on a graph (for my purposes it is a

## How do I fill Matrix4 with translation, skew and scale values in flutter?

Suppose, i have these values for a container of height 200 and width 300: scalex = 0.9198 scaley = 0.9198 skewx =

## Map larger number to 1-4 in 25000 steps

Some split testing shall be done on a website. there are 4 versions of the website and i have the total visitor count. every 25000 visitors i want

If one examines this block:

## Intersection of two Moving Objects

I'm trying to use the answer provided here:

## Bracket one of two roots in root finding algorithm for roots of a multivariate function

Apologies for the (maybe misleading) title and the probably confusing question itself, i struggle a lot with wording my problem and especially

## How to find the value of the variable by using the Cramer's rule (Python)?

The problem is, x + 3y − 2𝑧 = 1,3𝑥 + 2𝑦 + 6𝑧 = −2,2𝑥 + 4𝑦 + 3𝑧 = 2 . i want to know the value of the 𝑥,𝑦,and 𝑧

## Random Sample of N Distinct Permutations of a List

Suppose i have a python list of arbitrary length k. now, suppose i would like a random sample of n , (where n <= k!)