CircleMethods::thetaLength()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
/** @formatter:off
3
 * ******************************************************************
4
 * Created by   Marko Kungla on Jun 27, 2016 - 5:24:06 AM
5
 * Contact      [email protected]
6
 * @copyright   2016 Marko Kungla - https://github.com/mkungla
7
 * @license     The MIT License (MIT)
8
 * 
9
 * @category       AframeVR
10
 * @package        aframe-php
11
 * 
12
 * Lang         PHP (php version >= 7)
13
 * Encoding     UTF-8
14
 * File         CircleMethods.php
15
 * Code format  PSR-2 and 12
16
 * @link        https://github.com/mkungla/aframe-php
17
 * @issues      https://github.com/mkungla/aframe-php/issues
18
 * ********************************************************************
19
 * Contributors:
20
 * @author Marko Kungla <[email protected]>
21
 * ********************************************************************
22
 * Comments:
23
 * @formatter:on */
24
namespace AframeVR\Core\Components\Geometry\Methods;
25
26
class CircleMethods
27
{
28
29
    /**
30
     * Radius (in meters) of the circle.
31
     *
32
     * @param array $dom_attributes            
33
     * @param double $radius            
34
     * @return void
35
     */
36 3
    public function radius(array &$dom_attributes, float $radius)
37
    {
38 3
        $dom_attributes['radius'] = $radius;
39 3
    }
40
41
    /**
42
     * Segments
43
     *
44
     * CIRCLE: Number of triangles to construct the circle, like pizza slices.
45
     * A higher number of segments means the circle will be more round.
46
     *
47
     * @param array $dom_attributes            
48
     * @param int $segments            
49
     * @return void
50
     */
51 3
    public function segments(array &$dom_attributes, int $segments)
52
    {
53 3
        $dom_attributes['segments'] = $segments;
54 3
    }
55
56
    /**
57
     * Start angle for first segment.
58
     * Can be used to define a partial circle.
59
     *
60
     * @param array $dom_attributes            
61
     * @param double $thetaStart            
62
     * @return void
63
     */
64 3
    public function thetaStart(array &$dom_attributes, float $thetaStart)
65
    {
66 3
        $dom_attributes['thetaStart'] = $thetaStart;
67 3
    }
68
69
    /**
70
     * Defaults to 360, which makes for a complete circle.
71
     *
72
     * @param array $dom_attributes            
73
     * @param double $thetaLength            
74
     * @return void
75
     */
76 3
    public function thetaLength(array &$dom_attributes, float $thetaLength)
77
    {
78 3
        $dom_attributes['thetaLength'] = $thetaLength;
79 3
    }
80
}
81