geometry

How to scatter plot two concentric circles with Numpy and Matplotlib

How to scatter plot two concentric circles with Numpy and Matplotlib Question: I’m trying to recreate the following plot with Numpy and Matplotlib as part of a question, but I’m struggling to get the "random aspect" of the plot: I’ve already managed to create the two circles and plot them with this code: import numpy …

Total answers: 2

remove polygons with an intersection higher than a threshold

remove polygons with an intersection higher than a threshold Question: The goal is to remove polygons with an intersection higher than a threshold, let’s say 80% of the area from the smaller intersected polygon. In the following picture we see in first image how the small red circle in coordinate (2.06, 41.41) is overlapping with …

Total answers: 1

tkinter rounded button has white border

tkinter rounded button has white border Question: I managed to find in someone who made a class for rounded buttons in tkinter that works great. However the issue I have is there is always a white border. I’ve tried reading through all of the code and changing all of the colour values but to no …

Total answers: 2

Draw circle with longitude, latitude and radius (km) in cartopy of python

Draw circle with longitude, latitude and radius (km) in cartopy of python Question: #!/usr/bin/env python import os, sys import pandas as pd import cartopy import cartopy.crs as ccrs import matplotlib.pyplot as plt import shapely.geometry as sgeom import numpy as np from cartopy.geodesic import Geodesic if __name__ == ‘__main__’: stn = pd.read_csv(‘obs_station.csv’) gd = Geodesic() lcc …

Total answers: 1

Python function to find a point of an equilateral triangle

Python function to find a point of an equilateral triangle Question: I am trying to write a function equilateral(x, y): that takes two np.ndarrays of shape (N,) , where x and y are natural numbers and returns a point z an np.ndarray of shape (N,) such that (x, y, z) are are the vertices of …

Total answers: 3

Intersection of two line segments in Python

Intersection of two line segments in Python Question: Different articles have discussed about the intersection of two line segments in Python such as How do I compute the intersection point of two lines?, Numpy and line intersections, How can I check if two segments intersect? But, no one made it perfect since, they did not …

Total answers: 2

Using vector cross product to hide 3D faces

Using vector cross product to hide 3D faces Question: The code creates 3D coordinates for the cube and then displays them on the 2D screen but you can still see the back faces of the cube. What is the best method for hiding these faces? points = [(-1,-1,-1),(-1,-1,1),(-1,1,1),(-1,1,-1), (1,-1,-1),(1,-1,1),(1,1,1),(1,1,-1), ]#coords for points faces = [(3,0,4,7),(1,5,6,2),(2,1,0,3),(5,4,7,6),(3,2,6,7),(0,1,5,4)] …

Total answers: 1

Position + Euler Angles to Transformation Matrix

Position + Euler Angles to Transformation Matrix Question: I have a position and three Euler angles from a Unity scene: # position cam_pos = [-0.1219461, -0.04402884, -1.995793] # rotation (in degrees) cam_rot = [-1.261, 176.506, 0.038] In Unity the coordinate system is LHS and the Euler angle convention is Z,X,Y. I’d like to know how …

Total answers: 1