scaffold.libs_as.feathers.utils.geom.matrixToScaleX.as Maven / Gradle / Ivy
/*
Feathers
Copyright 2012-2015 Bowler Hat LLC. All Rights Reserved.
This program is free software. You can redistribute and/or modify it in
accordance with the terms of the accompanying license agreement.
*/
package feathers.utils.geom
{
import flash.geom.Matrix;
/**
* Extracts the x scale value from a flash.geom.Matrix
*
* @see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html flash.geom.Matrix
*/
public function matrixToScaleX(matrix:Matrix):Number
{
var a:Number = matrix.a;
var b:Number = matrix.b;
return Math.sqrt(a * a + b * b);
}
}