From Fernandez Guasti (1992) paper use squared factor as squircle.
Let we follow it.
Change-Id: Icbd6cb18f7dd0b243bc38d069d1e1c47016a5a7b
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
gPotential = sqrt(((positiveDiff.x + positiveDiff.y)
+ sqrt(positiveDiff.x * positiveDiff.x
+ positiveDiff.y * positiveDiff.y
- + (2.0 - 4.0 * gSquareness) * positiveDiff.x * positiveDiff.y))
+ + (2.0 - 4.0 * gSquareness * gSquareness) * positiveDiff.x * positiveDiff.y))
* 0.5)
+ min(0.0, max(gDiff.x, gDiff.y)); ///< Consider negative potential, to support borderline
#else
gPotential = sqrt(((positiveDiff.x + positiveDiff.y)
+ sqrt(positiveDiff.x * positiveDiff.x
+ positiveDiff.y * positiveDiff.y
- + (2.0 - 4.0 * gSquareness) * positiveDiff.x * positiveDiff.y))
+ + (2.0 - 4.0 * gSquareness * gSquareness) * positiveDiff.x * positiveDiff.y))
* 0.5)
+ min(0.0, max(gDiff.x, gDiff.y)); ///< Consider negative potential, to support borderline
#else
gPotential = sqrt(((positiveDiff.x + positiveDiff.y)
+ sqrt(positiveDiff.x * positiveDiff.x
+ positiveDiff.y * positiveDiff.y
- + (2.0 - 4.0 * gSquareness) * positiveDiff.x * positiveDiff.y))
+ + (2.0 - 4.0 * gSquareness * gSquareness) * positiveDiff.x * positiveDiff.y))
* 0.5)
+ min(0.0, max(gDiff.x, gDiff.y)); ///< Consider negative potential, to support borderline
#else
return sqrt(((positiveDiff.x + positiveDiff.y)
+ sqrt(positiveDiff.x * positiveDiff.x
+ positiveDiff.y * positiveDiff.y
- + (2.0 - 4.0 * squareness) * positiveDiff.x * positiveDiff.y))
+ + (2.0 - 4.0 * squareness * gSquareness) * positiveDiff.x * positiveDiff.y))
* 0.5)
+ min(0.0, max(diff.x, diff.y)) ///< Consider negative potential, to avoid visual defect when radius is zero
- radius;