i've got a formula for calculating the area of a triangle:

vb Code:
  1. x1 = points(1).X
  2. y1 = points(1).Y
  3. x2 = points(2).X
  4. y2 = points(2).Y
  5. x3 = points(0).X
  6. y3 = points(0).Y
  7. Dim area As Decimal = (0.5 * ((x1 * (y2 - y3)) + (x2 * (y3 - y1)) + (x3 * (y1 - y2))))
  8. Debug.Print(unitConverter.pixelsSquaredToCMSquared(gr, area))

it works well but it calculates the output in pixels² + i need it to be cm²

heres my converter function that works well converting a pixel length to a cm length, but doesn't work with pixels²:

vb Code:
  1. Public Shared Function pixelsSquaredToCMSquared(ByVal gr As Graphics, ByVal pixels As Decimal) As Decimal
  2.     Return (pixels / gr.DpiX) * 2.54
  3. End Function

what am i doing wrong?