At first this sounds like a very popular and often asked/solved question but it has a twist - I need help with the twist please. 1. The problem statement, all variables and given/known data A cannon is at Point A in a 3d environment. There is a wall at Point B which sits between the cannon and a castle, at Point C. Write a function that will find the angle and initial velocity required to fire a cannonball so that it just passes the top of the wall and hits the castle. (Meaning it should be in the air for the shortest time possible). I also assume this is easier to work out by considering the top of the wall and the castle as two points the ball must pass through. The cannon has no limit on it's power - so the initial velocity can be anything. The twist - The wall that the cannonball must get over is not at the midpoint between the cannon and the castle, it may instead be at any distance between the cannon and the castle (and at any height). The variables: cannon position, wall height and position, castle position. The knowns: the cannon's power is unlimited, the cannon's angle is anywhere between 0 and 90 degrees from the horizontal, gravity. 2. Relevant equations y = v0yt -.5gt^2 x= v0xt 3. The attempt at a solution I've solved it for when the wall blocking the cannon and castle is directly in the middle of the parabolic arc. However I don't know what formulas to use or how to work out the required formula for when the wall is not directly in the middle. Just to be clear; if the cannon was at 0,0 and the castle was at 100,0 then the wall could be at any point along the x axis between 0 and 100... 0<wall<100.