I'm trying to find the (x, y, z) intersection of a cylinder and a plane given a cylinder aligned to the z axis and a plane rotated around the y axis like that shown below. The other parameter involved would be the angle around the z axis by which the intersection is located. This would have the inputs (R, y_rotation, z_rotation) - the cylinder would be centered at (0, 0) and projected to infinity while the plane would also cross through (0, 0, 0).
The (x, y) portion of this is simple enough - it's just projecting a point from the cylinder's center (x, y) by the angle for the distance R - for which I'm using the two formulas below (this is going into OpenSCAD, so the function definitions aren't the prettiest things.) What I'm stuck on is how to get the Z value of the intersection:
function x_cylinder_plane_intersection(z_angle, radius) = (radius * cos(z_angle)); function y_cylinder_plane_intersection(z_angle, radius) = (radius * sin(z_angle)); function z_cylinder_plane_intersection(y_angle, z_angle, radius) = ?