# How do you use the streckeisen (QAPF) classification ternary diagram to identify igneous rocks based on chemical rock composition?

I have been given the following diagrams: and
and a database that is structured like this:

ROCK NAME |SIO2 |TIO2| AL2O3|   CR2O3|  FEOT|   CAO|    MGO|    MNO|    K2O|    NA2O|   P2O5|
WEHRLITE    |45.42| 0.17|   2.57|   0.32|   11.3384|    7.54|   31.93|  0.17|   0.01|   0.24|   0.01|


I want to know how to normalize the data and use these diagrams to identify the rock name based on the IUGS specification. I then am tasked to write a program that will do this automatically meaning that I have to come up with some semi-mathematically-based process to identify these rocks. Any ideas?