geometry-surface

Finding the intersection of the Circle and Infinite Cylinder in 3D space

孤者浪人 提交于 2021-02-20 04:32:04
问题 Finding the intersection of the Circle and Infinite Cylinder. (all in 3D) • Circle is defined by center, plane in which it lies and radius. • Cylinder is defined by axis and radius. how can i get the intersection of these two? 回答1: WLOG the cylinder has equation X² + Y² = 1 (if not, you can make it so by translation, rotation and scaling). Then the parametric equation of the circle is P = C + U cos t + V sin t where C is the center point and U , V two orthogonal vectors in the circle plane,

python pygame blit. Getting an image to display

纵然是瞬间 提交于 2021-02-16 21:14:05
问题 I'm trying to get my webcam to show video through pygame. Here is the code: # import the relevant libraries import time import pygame import pygame.camera from pygame.locals import * # this is where one sets how long the script # sleeps for, between frames.sleeptime__in_seconds = 0.05 # initialise the display window pygame.init() pygame.camera.init() screen = pygame.display.set_mode((640, 480), 0, 32) # set up a camera object cam = pygame.camera.Camera(0) # start the camera cam.start() while

How to calculate the coordinates of points in a circle using Java?

本秂侑毒 提交于 2020-12-15 06:28:04
问题 I found this website where you try drawing a perfect circle. Just for fun I coded this small Java application, that draws a circle from the middle of your screen: // here is my massive array private static int[] circle = {0, -100, 1, -100, 2, -100, 3, -100, 4, -100, 5, -100, 6, -100, 7, -100, 8, -100, 9, -100, 10, -100, 11, -99, 12, -99, 13, -99, 14, -99, 15, -99, 16, -99, 17, -98, 18, -98, 19, -98, 20, -98, 21, -98, 22, -97, 23, -97, 24, -97, 25, -97, 26, -96, 27, -96, 28, -96, 29, -96, 30,

How to calculate the coordinates of points in a circle using Java?

不羁岁月 提交于 2020-12-15 06:27:11
问题 I found this website where you try drawing a perfect circle. Just for fun I coded this small Java application, that draws a circle from the middle of your screen: // here is my massive array private static int[] circle = {0, -100, 1, -100, 2, -100, 3, -100, 4, -100, 5, -100, 6, -100, 7, -100, 8, -100, 9, -100, 10, -100, 11, -99, 12, -99, 13, -99, 14, -99, 15, -99, 16, -99, 17, -98, 18, -98, 19, -98, 20, -98, 21, -98, 22, -97, 23, -97, 24, -97, 25, -97, 26, -96, 27, -96, 28, -96, 29, -96, 30,

Python: fit 3D ellipsoid (oblate/prolate) to 3D points

守給你的承諾、 提交于 2020-05-14 09:13:02
问题 Dear fellow stackoverflow users, I face a problem as follows: I would like to fit a 3D ellipsoid to 3D data points within my python script. The starting data are a set of x, y and z coordinates (cartesian coordinates). What I would like to get are a and c in the defining equation of the best-fit ellipsoid of the convex hull of the 3D data points. The equation is, in the properly rotated and translated coordinate system: So the tasks I would ideally like to do are: Find convex hull of 3D data

How to plot geodesic curves on a surface embedded in 3D?

寵の児 提交于 2020-04-28 08:44:12
问题 I have in mind this video, or this simulation, and I would like to reproduce the geodesic lines on some sort of surface in 3D, given by a function f(x,y), from some starting point. The midpoint method seems computationally and code intense, and so I'd like to ask if there is a way to generate an approximate geodesic curve based on the normal vector to the surface at different points. Each point has a tangent vector space associated with it, and therefore, it seems like knowing the normal

How to get rid of pygame surfaces?

人盡茶涼 提交于 2020-01-22 12:56:45
问题 In the following code, there is not just one circle on the screen at any given point in time. I want to fix this to make it so that it looks like there is only one circle, instead of leaving a smudge trail where ever the mouse cursor has been. import pygame,sys from pygame.locals import * pygame.init() screen = pygame.display.set_mode((640,400),0,32) radius = 25 circle = pygame.Surface([radius*2]*2,SRCALPHA,32) circle = circle.convert_alpha() pygame.draw.circle(circle,(25,46,100),[radius]*2

How to get rid of pygame surfaces?

六月ゝ 毕业季﹏ 提交于 2020-01-22 12:56:09
问题 In the following code, there is not just one circle on the screen at any given point in time. I want to fix this to make it so that it looks like there is only one circle, instead of leaving a smudge trail where ever the mouse cursor has been. import pygame,sys from pygame.locals import * pygame.init() screen = pygame.display.set_mode((640,400),0,32) radius = 25 circle = pygame.Surface([radius*2]*2,SRCALPHA,32) circle = circle.convert_alpha() pygame.draw.circle(circle,(25,46,100),[radius]*2