1) The Y positioning needs to be calculated with Sine. Notice below that both X & Y formulas has Cosine

2) The order of operations in both positioning formulas isn't right. Notice the highlighting below where it's 5 x ( cos(...) + 512). It needs to be (5 x cos(...)) + 512. Same for the sine formula. Just switch the 512 & 0 for cos and switch the 384 & 0 for sine.