Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

rotate point around point python

from math import sin, cos

def rotate(origin, point, angle):
        #Rotate a point counterclockwise by a given angle around a given origin.
        #The angle should be given in radians.
        x = origin[0] + cos(angle) * (point[0] - origin[0]) - sin(angle) * (point[1] - origin[1])
        y = origin[1] + sin(angle) * (point[0] - origin[0]) + cos(angle) * (point[1] - origin[1])
        return (x, y)
Comment

PREVIOUS NEXT
Code Example
Python :: standardise columns python 
Python :: np.polyfit plot 
Python :: LoginRequiredMixin 
Python :: python ssh into server 
Python :: finding the rows in a dataframe where column contains any of these values python 
Python :: find unique char in string python 
Python :: basic tkinter window 
Python :: intersect in python list 
Python :: scroll down selenium python 
Python :: delete all elements in list python 
Python :: remove extra spaces and empty lines from string python 
Python :: shuffle list 
Python :: plt .show 
Python :: python bitwise operators 
Python :: ion flux relabeling 
Python :: python get memory address 
Python :: how to use elif in python 
Python :: obtener el mayor valor de un diccionario python 
Python :: plt.tick_params 
Python :: count of datatypes in columns 
Python :: delete dictionary key python 
Python :: tqdm enumerate 
Python :: python formatting strings 
Python :: python tkinter colored line 
Python :: saving model in pytorch 
Python :: how to retrieve dictionary values in python by index 
Python :: count a newline in string python 
Python :: replace values in a column by condition python 
Python :: binary representation python 
Python :: pandas where 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =