POV-Ray : Newsgroups : povray.general : Brsuhing up on math - intersection sphere-cylinder : Re: Brsuhing up on math - intersection sphere-cylinder Server Time
8 Aug 2024 10:25:13 EDT (-0400)
  Re: Brsuhing up on math - intersection sphere-cylinder  
From: Wlodzimierz ABX Skiba
Date: 8 Jan 2001 08:17:14
Message: <3a59bdda$1@news.povray.org>
Remco de Korte wrote in message <3A5990BE.2E6AC598@onwijs.com>...
>If I have a sphere with radius 1 intersected by a cylinder with radius .5, with
>an axis in the z-direction through point <.75,0>

on x-y plane, right ?

> how can I calculate the points
> on the curve where these two intersect?

input
  R1=1
  R2=.5
  H=.75
sphere equatiuon
  x^2 + y^2 + z^2 = R1^2
cylinder equation
  x^2 + (y-H)^2 = R2^2
we substract both equations side by side to remove x^2
  y^2 + z^2 - (y-H)^2 = R1^2 - R2^2
after reduction we obtain equation for y
  y = ( R1^2 - R2^2 + H^2 -z^2 ) / ( 2 * H )
using cylinder equation you can calculate two values of x
  x = +/- sqrt( R2^2 - (y-H)^2 )

I have not tested it but I hope it'll help you
Should be very interesting to write parametric equation for it
to distribute evenly points on it

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.