Category "math"

I think I'm expressing this summation incorrectly in MATLAB?

I'm trying to code the following sum (which is the solution for a functional DE): This sum is valid for t in [nT, (n+1)T], where T is a constant number (found

How to find the center and radius of an any dimensional sphere giving dims+1 points

given a vector of N-dimensional points. The vector will be of size N+1. Is there a generalized algorithm to find the center and radius of the ND sphere using th

Moving window size for time series analysis : Minimum description length and Fractal data dimension

I'm doing the time-series analysis as a hobby and am attempting to discover the optimal window size. After some study, I found 2 techniques that had been mentio

How is math.copysign(x, y) in Python useful?

I was going over the functions of the math module in Python and found the math.copysign (x,y) function. I want to know when someone would use this function. I

WPF Canvas: Rotate a grouped shape

In my WPF application, I am trying to rotate a set of grouped shapes inside a canvas. I am getting grouped shape object TOP/LEFT position using the formulae men

WPF Canvas: Rotate a grouped shape

In my WPF application, I am trying to rotate a set of grouped shapes inside a canvas. I am getting grouped shape object TOP/LEFT position using the formulae men

Classifying cubic bezier curves according to Loop & Blinn 2005

I am trying flatten a bezier path (remove all intersections and replace with end points) as part of the implementation of the rendering algori

Convert 8 points to a rectangle

I draw 4 lines through 8 points on my picturebox which creates a rectangle. float xnum = 0.580481F; float ynum = 0.373782F;

Minimum moves to transform a list so that each element equals its own frequency

Given a sorted array like [1,2,4,4,4]. Each element in the array should occur exactly same number of times as element. For Example 1 should occur 1 time, 2 shou

Python Cartesian plane plot and line

I want to create a cartesian plane in python that looks similar to the attached image, where I have 2 sets of coordinates e.g. (7,7) (17.4,20), and a line going

How can I calculate the tens place value of 2^100 in C++?

How can I calculate the tens place value of 2^100 in C++? I tried this; #include <cmath> #include <iostream> using namespace std; int main(){

Convert Calendar Days to Working Days (and Vice Versa) | 4 Day Work Week

I have values corresponding to 'Calendar Days.' I'd like to convert this to 'Working Days.' In this example, a 'Working Day' is defined by Monday through Thurs

Calculate spin frequency from rotation change in degrees

I have an object that rotates in the same direction at a variable speed. I have the ability to measure the angle of this object in degrees (0-360) every frame (

center of mass in each cell of N-dimensional rectilinear grid

I have an n-Dimensional rectilinear grid, such that the edges in each dimension i are given by x_i = {x[i, 0], x[i,1], ..., x[i, Ni-1], x[i, Ni]}, with N_i edge

Plot Cassini ovals in Python using numpy and matplotlib

I am trying to plot Cassini ovals in Python using these parametric equations for x,y. https://mathcurve.com/courbes2d.gb/cassini/cassini.shtml Here is my progra

PCA on sklearn - how to interpret pca.components_

I ran PCA on a data frame with 10 features using this simple code: pca = PCA() fit = pca.fit(dfPca) The result of pca.explained_variance_ratio_ shows: array

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 = -0.3923 skewY = 0.3923 translateX = 150 transl

How to put mathematical equations in source code without making it unreadable?

When implementing complex calculations, I found that readability suffered a lot. For example, this formula is absolutely unreadable when translated to code (I c

Scaling the X axis of a rotated ellipse

I have a scatter plot and I'm allowing points to be selected by drawing an ellipse like so: In the above image the X axis and Y axis are scaled differently. I'

Scale current item to 1

I wonder how to scale the current index from 1 to 0.8 when swiping to the next item. I've been building a carousel on how to make the centered item from 1 to 0.