Skip to content Skip to sidebar Skip to footer
Showing posts with the label Math

Sine Wave That Exponentialy Changes Between Frequencies F1 And F2 At Given Time/amount Of Samples

I'm trying to implement Python method that generates sine wave, which ramps up between two freq… Read more Sine Wave That Exponentialy Changes Between Frequencies F1 And F2 At Given Time/amount Of Samples

Looking For A Specific Combination Algorithm To Solve A Problem

Let’s say I have a purchase total and I have a csv file full of purchases where some of them make u… Read more Looking For A Specific Combination Algorithm To Solve A Problem

Variable Changes Without Being Touched

I'm quite new to Python but this is strange. So, I have a matrix (a list of lists) and I pass i… Read more Variable Changes Without Being Touched

Separating Axis Theorem And Python

This is what I am currently doing: Creating 4 axis that are perpendicular to 4 edges of 2 rectangle… Read more Separating Axis Theorem And Python

Parseval's Theorem In Python

I'm trying to get some grip on Python's fft functionality, and one of the weird things that… Read more Parseval's Theorem In Python

Ignore Imaginary Roots In Sympy

I'm using sympy to solve a polynomial: x = Symbol('x') y = solve(int(row['scaleA… Read more Ignore Imaginary Roots In Sympy

How To Prevent Automatic Rounding In Print Function When Printing A Float Number?

Let's consider this situation: from math import sqrt x = sqrt(19) # x : 4.358898943540674 pri… Read more How To Prevent Automatic Rounding In Print Function When Printing A Float Number?

If X>=1, Then 1, Otherwise 0, As Pure Math Equation?

Due to the constraints of some dev tools, I'm looking for a mathematical expression of: If x>… Read more If X>=1, Then 1, Otherwise 0, As Pure Math Equation?

Simple (working) Handwritten Digit Recognition: How To Improve It?

I just wrote this very simple handwritten digit recoginition. Here is 8kb archive with the followin… Read more Simple (working) Handwritten Digit Recognition: How To Improve It?

Calculate Pixel Coordinates For 8 Equidistant Points On A Circle

I have a circle centred at 0 with radius 80. How using python do I calculate the coordinates for 8 … Read more Calculate Pixel Coordinates For 8 Equidistant Points On A Circle

Converting Floating Ratios To Int

I need to convert float ratios to their integer equivalent 0.5:1 ---should convert to ---> 1:2 0… Read more Converting Floating Ratios To Int

Get All Numbers That Add Up To A Number

I'm trying to find a way to display all the possible sets of X integers that add up to a given … Read more Get All Numbers That Add Up To A Number

String In List, Into A Function

myList = ['100', 'sin(x)', '0', '1'] I read these strings from a t… Read more String In List, Into A Function

How May I Project Vectors Onto A Plane Defined By Its Orthogonal Vector In Python?

I have a plane, plane A, defined by its orthogonal vector, say (a, b, c). (i.e. the vector (a, b, c… Read more How May I Project Vectors Onto A Plane Defined By Its Orthogonal Vector In Python?

Calculating Distance Between Latitude And Longitude In Python?

I need help calculating the distance between two points-- in this case, the two points are longitud… Read more Calculating Distance Between Latitude And Longitude In Python?

Calculate Antilog In Python? Np.exp / Math.exp Doesn't Work

I have an array of log values temp= [4,4.05......9] These are actually from 10^4 to 10^9 for exampl… Read more Calculate Antilog In Python? Np.exp / Math.exp Doesn't Work

Wrong Asin Result

My code: import math x = input() print(math.asin(math.radians(float(x)))) My x was 0.7071067811865… Read more Wrong Asin Result

Optimized Dot Product In Python

The dot product of two n-dimensional vectors u=[u1,u2,...un] and v=[v1,v2,...,vn] is is given by u1… Read more Optimized Dot Product In Python

How To Redistribute Points Evenly Over A Curve

I have some arbitrary curve in 3 dimensions made up of a list of XYZ cartesian points. The points … Read more How To Redistribute Points Evenly Over A Curve

Rounding Floats So That They Sum To Precisely 1

I have a rather gnarly bit of code that must more-or-less randomly generate a bunch of percentages,… Read more Rounding Floats So That They Sum To Precisely 1