The fundamental importance of prime numbers for mathematics is that all other natural numbers can be represented as a unique product of prime numbers[1]. For centuries, mathematicians have been trying to find an order in the occurrence of prime numbers. Since Riemann´s paper on the number of primes under a given size, the distribution of the primes is assumed to be random[2]. Here, I show that prime numbers are not randomly distributed. Their positions are determined by the order of occurrence of the nonprimes of types 6n+5 and 6n+1. By using parametric sine functions, I will show here that all assumptions known today regarding the distribution of prime numbers larger than 3 are wrong. In particular, this refutes Riemann´s hypothesis of random distribution of prime numbers. Furthermore, I will show an exact primality test based on these parametric sine functions, which only uses one parameter.