Category "trigonometry"

Sine fitting using scipy is not returning good fit

trying to fit some sine wave to data i collected. But Amplitude and Frequency are way off. Any suggestions? x=[0,1,3,4,5,6,7,11,12,13,14,15,16,18,20,21,22,24,26

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 (

How to calculate spectral derivative using scipy.fftpack (DST, DCT)

scipy.fftpack package provides a large number of routines related to Discrete Fourier transforms. I need to calculate 1st and 2nd derivative of a function using

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'

move an object towards a target but in a sine wave

unity2d and by ship I mean spaceship. so I have my ship which I want to move to a specific target, but I want it to be in a sin wave so it bounces up and down,

Translating Screen Coordinates [ x, y ] to Camera Pan and Tilt angles

I have a IP Camera which can PTZ. I am currently streaming live feed into the browser and want to allow user to click a point on the screen and the camera will

Plotting all of a trigonometric function (x^2 + y^2 == 1) with matplotlib and python

As an exercise in learning Matplotlib and improving my math/coding I decided to try and plot a trigonometric function (x squared plus y squared equals one). Tr

Python degrees defaulting to radians

I'm trying to print out the x,y value for a line with a certain degree which intersects a circle with a specified radius. Lets say for example that the line is

How do I generate a sine wave using Python?

I'm trying to generate a sine wave of a given frequency for a given duration and then write it into a .wav file. I'm using numpy's sin function and scipy's wavf

Rotate a 3D- Point around another one

I have a function in my program which rotates a point (x_p, y_p, z_p) around another point (x_m, y_m, z_m) by the angles w_nx and w_ny. The new coordinates are

How to find a point where a line intersects an ellipse in 2D (C#)

I need to find a point where a line (its origin is ellipse' center) intersects an ellipse in 2D... I can easily find a point on a circle, because I know an angl