本文整理汇总了PHP中Shape::calcPerimeter方法的典型用法代码示例。如果您正苦于以下问题:PHP Shape::calcPerimeter方法的具体用法?PHP Shape::calcPerimeter怎么用?PHP Shape::calcPerimeter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shape
的用法示例。
在下文中一共展示了Shape::calcPerimeter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Shape
<?php
require 'shape.php';
$myShape = new Shape();
echo "Shape methods: </br>";
$myShape->setPoints(5, 45);
$myShape->setPoints(55, 145);
$myShape->setPoints(45, 85);
$myShape->setPoints(56, 10);
$myShape->setPoints(45, 15);
$myShape->setPoints(56, 10);
$myShape->setPoints(39, 87);
$myShape->setPoints(17, 46);
echo "My points are:";
var_dump($myShape->getPoints());
echo "The perimeter of my shape is: " . $myShape->calcPerimeter() . "<br/>";
$myShape->modifyPointOnIndex(12, 13, 3);
echo "I just modified points of index 3! Now the point on index 3 has coordinates as follows: ";
var_dump($myShape->getPointOnIndex(3));
$myShape->deletePointOnIndex(2);
echo "I just delete a point of index 2!";
echo "Now my points are:";
var_dump($myShape->getPoints());