defyma / nine-grid-classification
实现9宫格分类
0.1.0
2019-08-28 04:08 UTC
This package is auto-updated.
Last update: 2024-09-28 17:07:17 UTC
README
简单的9宫格分类实现辅助工具。
9宫格人才管理的示例案例
安装
composer require defyma/nine-grid-classification
用法
... $_9Grid = new \defyma\helper\NineGridClassification(); $_9Grid->setPoint($X, $Y, $X1, $X2, $Y1, $Y2); $classification = $_9Grid->calculate($scoreX, $scoreY); ...
示例
... $_9Grid = new \defyma\helper\NineGridClassification(); $_9Grid->setPoint(6,6); $classification = $_9Grid->calculate(1, 5); echo $classification; \\ 7 ...
... $_9Grid = new \defyma\helper\NineGridClassification(); $_9Grid->setPoin(6,6,4,5,3,5); $classification = $_9Grid->calculate(1, 5); echo $classification; \\ 4 ...
API
setPoin
$X
是 X 轴 | 必需$Y
是 Y 轴 | 必需$X1
是 X1 点$X2
是 X2 点$Y1
是 Y1 点$Y2
是 Y2 点
计算
$scoreX
是 X 分数 | 必需$scoreY
是 Y 分数 | 必需