sketchup-api-stubs 0.6.1 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/lib/sketchup-api-stubs.rb +1 -1
  4. data/lib/sketchup-api-stubs/sketchup.rb +145 -145
  5. data/lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb +318 -318
  6. data/lib/sketchup-api-stubs/stubs/Geom/Bounds2d.rb +172 -172
  7. data/lib/sketchup-api-stubs/stubs/Geom/LatLong.rb +126 -126
  8. data/lib/sketchup-api-stubs/stubs/Geom/OrientedBounds2d.rb +102 -102
  9. data/lib/sketchup-api-stubs/stubs/Geom/Point2d.rb +400 -401
  10. data/lib/sketchup-api-stubs/stubs/Geom/Point3d.rb +661 -661
  11. data/lib/sketchup-api-stubs/stubs/Geom/PolygonMesh.rb +492 -492
  12. data/lib/sketchup-api-stubs/stubs/Geom/Transformation.rb +478 -478
  13. data/lib/sketchup-api-stubs/stubs/Geom/Transformation2d.rb +263 -263
  14. data/lib/sketchup-api-stubs/stubs/Geom/UTM.rb +141 -141
  15. data/lib/sketchup-api-stubs/stubs/Geom/Vector2d.rb +522 -523
  16. data/lib/sketchup-api-stubs/stubs/Geom/Vector3d.rb +691 -691
  17. data/lib/sketchup-api-stubs/stubs/Layout.rb +25 -25
  18. data/lib/sketchup-api-stubs/stubs/Layout/AngularDimension.rb +573 -569
  19. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinition.rb +411 -411
  20. data/lib/sketchup-api-stubs/stubs/Layout/AutoTextDefinitions.rb +174 -186
  21. data/lib/sketchup-api-stubs/stubs/Layout/ConnectionPoint.rb +70 -70
  22. data/lib/sketchup-api-stubs/stubs/Layout/Document.rb +514 -455
  23. data/lib/sketchup-api-stubs/stubs/Layout/Ellipse.rb +29 -29
  24. data/lib/sketchup-api-stubs/stubs/Layout/Entities.rb +143 -155
  25. data/lib/sketchup-api-stubs/stubs/Layout/Entity.rb +353 -359
  26. data/lib/sketchup-api-stubs/stubs/Layout/FormattedText.rb +349 -349
  27. data/lib/sketchup-api-stubs/stubs/Layout/Grid.rb +311 -123
  28. data/lib/sketchup-api-stubs/stubs/Layout/Group.rb +261 -261
  29. data/lib/sketchup-api-stubs/stubs/Layout/Image.rb +91 -86
  30. data/lib/sketchup-api-stubs/stubs/Layout/Label.rb +371 -371
  31. data/lib/sketchup-api-stubs/stubs/Layout/Layer.rb +218 -218
  32. data/lib/sketchup-api-stubs/stubs/Layout/LayerInstance.rb +128 -128
  33. data/lib/sketchup-api-stubs/stubs/Layout/Layers.rb +220 -232
  34. data/lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb +567 -563
  35. data/lib/sketchup-api-stubs/stubs/Layout/LockedEntityError.rb +10 -10
  36. data/lib/sketchup-api-stubs/stubs/Layout/LockedLayerError.rb +11 -11
  37. data/lib/sketchup-api-stubs/stubs/Layout/Page.rb +183 -183
  38. data/lib/sketchup-api-stubs/stubs/Layout/PageInfo.rb +387 -387
  39. data/lib/sketchup-api-stubs/stubs/Layout/Pages.rb +204 -216
  40. data/lib/sketchup-api-stubs/stubs/Layout/Path.rb +344 -344
  41. data/lib/sketchup-api-stubs/stubs/Layout/Rectangle.rb +174 -174
  42. data/lib/sketchup-api-stubs/stubs/Layout/SketchUpModel.rb +694 -547
  43. data/lib/sketchup-api-stubs/stubs/Layout/Style.rb +1519 -1519
  44. data/lib/sketchup-api-stubs/stubs/Layout/Table.rb +290 -290
  45. data/lib/sketchup-api-stubs/stubs/Layout/TableCell.rb +149 -149
  46. data/lib/sketchup-api-stubs/stubs/Layout/TableColumn.rb +139 -139
  47. data/lib/sketchup-api-stubs/stubs/Layout/TableRow.rb +135 -135
  48. data/lib/sketchup-api-stubs/stubs/Sketchup/Animation.rb +140 -140
  49. data/lib/sketchup-api-stubs/stubs/Sketchup/AppObserver.rb +157 -157
  50. data/lib/sketchup-api-stubs/stubs/Sketchup/ArcCurve.rb +209 -209
  51. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionaries.rb +152 -152
  52. data/lib/sketchup-api-stubs/stubs/Sketchup/AttributeDictionary.rb +281 -281
  53. data/lib/sketchup-api-stubs/stubs/Sketchup/Axes.rb +149 -149
  54. data/lib/sketchup-api-stubs/stubs/Sketchup/Behavior.rb +328 -328
  55. data/lib/sketchup-api-stubs/stubs/Sketchup/Camera.rb +577 -577
  56. data/lib/sketchup-api-stubs/stubs/Sketchup/ClassificationSchema.rb +63 -63
  57. data/lib/sketchup-api-stubs/stubs/Sketchup/Classifications.rb +122 -122
  58. data/lib/sketchup-api-stubs/stubs/Sketchup/Color.rb +281 -281
  59. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentDefinition.rb +562 -554
  60. data/lib/sketchup-api-stubs/stubs/Sketchup/ComponentInstance.rb +593 -593
  61. data/lib/sketchup-api-stubs/stubs/Sketchup/Console.rb +76 -76
  62. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionLine.rb +257 -257
  63. data/lib/sketchup-api-stubs/stubs/Sketchup/ConstructionPoint.rb +32 -32
  64. data/lib/sketchup-api-stubs/stubs/Sketchup/Curve.rb +194 -194
  65. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionList.rb +329 -329
  66. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionObserver.rb +72 -72
  67. data/lib/sketchup-api-stubs/stubs/Sketchup/DefinitionsObserver.rb +102 -102
  68. data/lib/sketchup-api-stubs/stubs/Sketchup/Dimension.rb +165 -165
  69. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionLinear.rb +312 -312
  70. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionObserver.rb +38 -38
  71. data/lib/sketchup-api-stubs/stubs/Sketchup/DimensionRadial.rb +87 -87
  72. data/lib/sketchup-api-stubs/stubs/Sketchup/Drawingelement.rb +390 -390
  73. data/lib/sketchup-api-stubs/stubs/Sketchup/Edge.rb +508 -508
  74. data/lib/sketchup-api-stubs/stubs/Sketchup/EdgeUse.rb +211 -211
  75. data/lib/sketchup-api-stubs/stubs/Sketchup/Entities.rb +1119 -1097
  76. data/lib/sketchup-api-stubs/stubs/Sketchup/EntitiesObserver.rb +125 -125
  77. data/lib/sketchup-api-stubs/stubs/Sketchup/Entity.rb +544 -537
  78. data/lib/sketchup-api-stubs/stubs/Sketchup/EntityObserver.rb +59 -59
  79. data/lib/sketchup-api-stubs/stubs/Sketchup/ExtensionsManager.rb +125 -125
  80. data/lib/sketchup-api-stubs/stubs/Sketchup/Face.rb +750 -750
  81. data/lib/sketchup-api-stubs/stubs/Sketchup/FrameChangeObserver.rb +104 -104
  82. data/lib/sketchup-api-stubs/stubs/Sketchup/Group.rb +697 -697
  83. data/lib/sketchup-api-stubs/stubs/Sketchup/Http.rb +27 -27
  84. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Request.rb +285 -285
  85. data/lib/sketchup-api-stubs/stubs/Sketchup/Http/Response.rb +62 -62
  86. data/lib/sketchup-api-stubs/stubs/Sketchup/Image.rb +409 -409
  87. data/lib/sketchup-api-stubs/stubs/Sketchup/ImageRep.rb +226 -226
  88. data/lib/sketchup-api-stubs/stubs/Sketchup/Importer.rb +190 -190
  89. data/lib/sketchup-api-stubs/stubs/Sketchup/InputPoint.rb +393 -393
  90. data/lib/sketchup-api-stubs/stubs/Sketchup/InstanceObserver.rb +82 -82
  91. data/lib/sketchup-api-stubs/stubs/Sketchup/InstancePath.rb +303 -303
  92. data/lib/sketchup-api-stubs/stubs/Sketchup/Layer.rb +285 -262
  93. data/lib/sketchup-api-stubs/stubs/Sketchup/Layers.rb +244 -231
  94. data/lib/sketchup-api-stubs/stubs/Sketchup/LayersObserver.rb +136 -136
  95. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing.rb +48 -48
  96. data/lib/sketchup-api-stubs/stubs/Sketchup/Licensing/ExtensionLicense.rb +86 -86
  97. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyle.rb +24 -24
  98. data/lib/sketchup-api-stubs/stubs/Sketchup/LineStyles.rb +112 -123
  99. data/lib/sketchup-api-stubs/stubs/Sketchup/Loop.rb +137 -137
  100. data/lib/sketchup-api-stubs/stubs/Sketchup/Material.rb +416 -416
  101. data/lib/sketchup-api-stubs/stubs/Sketchup/Materials.rb +311 -311
  102. data/lib/sketchup-api-stubs/stubs/Sketchup/MaterialsObserver.rb +141 -141
  103. data/lib/sketchup-api-stubs/stubs/Sketchup/Menu.rb +95 -95
  104. data/lib/sketchup-api-stubs/stubs/Sketchup/Model.rb +1638 -1483
  105. data/lib/sketchup-api-stubs/stubs/Sketchup/ModelObserver.rb +356 -356
  106. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsManager.rb +132 -132
  107. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProvider.rb +284 -282
  108. data/lib/sketchup-api-stubs/stubs/Sketchup/OptionsProviderObserver.rb +58 -58
  109. data/lib/sketchup-api-stubs/stubs/Sketchup/Page.rb +770 -650
  110. data/lib/sketchup-api-stubs/stubs/Sketchup/Pages.rb +353 -353
  111. data/lib/sketchup-api-stubs/stubs/Sketchup/PagesObserver.rb +76 -76
  112. data/lib/sketchup-api-stubs/stubs/Sketchup/PickHelper.rb +456 -456
  113. data/lib/sketchup-api-stubs/stubs/Sketchup/RegionalSettings.rb +43 -43
  114. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptions.rb +364 -356
  115. data/lib/sketchup-api-stubs/stubs/Sketchup/RenderingOptionsObserver.rb +44 -44
  116. data/lib/sketchup-api-stubs/stubs/Sketchup/SectionPlane.rb +150 -150
  117. data/lib/sketchup-api-stubs/stubs/Sketchup/Selection.rb +454 -454
  118. data/lib/sketchup-api-stubs/stubs/Sketchup/SelectionObserver.rb +115 -115
  119. data/lib/sketchup-api-stubs/stubs/Sketchup/Set.rb +212 -212
  120. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfo.rb +257 -257
  121. data/lib/sketchup-api-stubs/stubs/Sketchup/ShadowInfoObserver.rb +57 -57
  122. data/lib/sketchup-api-stubs/stubs/Sketchup/Style.rb +69 -69
  123. data/lib/sketchup-api-stubs/stubs/Sketchup/Styles.rb +211 -211
  124. data/lib/sketchup-api-stubs/stubs/Sketchup/Text.rb +262 -262
  125. data/lib/sketchup-api-stubs/stubs/Sketchup/Texture.rb +225 -225
  126. data/lib/sketchup-api-stubs/stubs/Sketchup/TextureWriter.rb +237 -237
  127. data/lib/sketchup-api-stubs/stubs/Sketchup/Tool.rb +829 -829
  128. data/lib/sketchup-api-stubs/stubs/Sketchup/Tools.rb +132 -132
  129. data/lib/sketchup-api-stubs/stubs/Sketchup/ToolsObserver.rb +154 -154
  130. data/lib/sketchup-api-stubs/stubs/Sketchup/UVHelper.rb +61 -61
  131. data/lib/sketchup-api-stubs/stubs/Sketchup/Vertex.rb +142 -142
  132. data/lib/sketchup-api-stubs/stubs/Sketchup/View.rb +1301 -995
  133. data/lib/sketchup-api-stubs/stubs/Sketchup/ViewObserver.rb +43 -43
  134. data/lib/sketchup-api-stubs/stubs/UI/Command.rb +310 -310
  135. data/lib/sketchup-api-stubs/stubs/UI/HtmlDialog.rb +356 -356
  136. data/lib/sketchup-api-stubs/stubs/UI/Notification.rb +229 -229
  137. data/lib/sketchup-api-stubs/stubs/UI/Toolbar.rb +240 -240
  138. data/lib/sketchup-api-stubs/stubs/UI/WebDialog.rb +633 -633
  139. data/lib/sketchup-api-stubs/stubs/_top_level.rb +311 -303
  140. data/lib/sketchup-api-stubs/stubs/array.rb +741 -741
  141. data/lib/sketchup-api-stubs/stubs/geom.rb +348 -233
  142. data/lib/sketchup-api-stubs/stubs/languagehandler.rb +92 -92
  143. data/lib/sketchup-api-stubs/stubs/length.rb +278 -262
  144. data/lib/sketchup-api-stubs/stubs/numeric.rb +249 -249
  145. data/lib/sketchup-api-stubs/stubs/sketchup.rb +1310 -1310
  146. data/lib/sketchup-api-stubs/stubs/sketchupextension.rb +353 -353
  147. data/lib/sketchup-api-stubs/stubs/string.rb +24 -24
  148. data/lib/sketchup-api-stubs/stubs/ui.rb +667 -660
  149. metadata +2 -16
@@ -1,141 +1,141 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The UTM class lets you work with UTM map coordinates.
5
- #
6
- # @note Valid ranges for {#zone_number} and {#zone_letter} are 1-60 and C-X
7
- # (omitting I and O). Valid ranges for {#x} and {#y} are 100000-899999.
8
- #
9
- # @version SketchUp 6.0
10
- class Geom::UTM
11
-
12
- # Instance Methods
13
-
14
- # The {#initialize} method is used to create a new UTM coordinate. You will
15
- # often create UTM objects by calling the method {Sketchup::Model#point_to_utm}
16
- # instead of calling this method.
17
- #
18
- # @example
19
- # # Create a copy of an existing UTM object.
20
- # utm = Geom::UTM.new(utm2)
21
- #
22
- # # Create a new UTM object from scratch.
23
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
24
- #
25
- # @overload initialize(zone_number, zone_letter, x, y)
26
- #
27
- # @param [Integer] zone_number A zone number or a UTM object.
28
- # @param [String] zone_letter A zone letter.
29
- # @param [Float] x The x position.
30
- # @param [Float] y The y position.
31
- #
32
- # @overload initialize(utm)
33
- #
34
- # @param [Geom::UTM] utm A UTM object.
35
- #
36
- # @overload initialize(array)
37
- #
38
- # @param [Array(Integer, String, Float, Float)] An array containing the zone
39
- # number, zone letter, x and y positions.
40
- #
41
- # @return [Geom::UTM]
42
- #
43
- # @version SketchUp 6.0
44
- def initialize(*args)
45
- end
46
-
47
- # The {#to_a} method returns a UTM coordinate as a 4 element array. The Array
48
- # elements are the zone number, the zone letter, the x coordinate and the y
49
- # coordinate.
50
- #
51
- # @example
52
- # # Create a new UTM object from scratch.
53
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
54
- # a = utm.to_a
55
- #
56
- # @return [Array(Integer, String, Float, Float)]
57
- #
58
- # @version SketchUp 6.0
59
- def to_a
60
- end
61
-
62
- # The {#to_latlong} method is used to convert UTM coordinates to latitude
63
- # and longitude. See the LatLong class for more information.
64
- #
65
- # @example
66
- # # Create a new UTM object from scratch.
67
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
68
- # ll = utm.to_latlong
69
- #
70
- # @return [Geom::LatLong]
71
- #
72
- # @version SketchUp 6.0
73
- def to_latlong
74
- end
75
-
76
- # The {#to_s} method is used to retrieve a string representation of a UTM.
77
- #
78
- # @example
79
- # # Create a new UTM object from scratch.
80
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
81
- # string = utm.to_s
82
- #
83
- # @return [String]
84
- #
85
- # @version SketchUp 6.0
86
- def to_s
87
- end
88
-
89
- # The {#x} method returns the UTM x coordinate.
90
- #
91
- # @example
92
- # # Create a new UTM object from scratch.
93
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
94
- # x = utm.x
95
- #
96
- # @return [Float]
97
- #
98
- # @version SketchUp 6.0
99
- def x
100
- end
101
-
102
- # The {#y} method returns the UTM y coordinate.
103
- #
104
- # @example
105
- # # Create a new UTM object from scratch.
106
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
107
- # y = utm.y
108
- #
109
- # @return [Float]
110
- #
111
- # @version SketchUp 6.0
112
- def y
113
- end
114
-
115
- # The {#zone_letter} method returns the UTM zone letter.
116
- #
117
- # @example
118
- # # Create a new UTM object from scratch.
119
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
120
- # zl = utm.zone_letter
121
- #
122
- # @return [String]
123
- #
124
- # @version SketchUp 6.0
125
- def zone_letter
126
- end
127
-
128
- # The {#zone_number} method returns the UTM zone number.
129
- #
130
- # @example
131
- # # Create a new UTM object from scratch.
132
- # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
133
- # zn = utm.zone_number
134
- #
135
- # @return [Integer]
136
- #
137
- # @version SketchUp 6.0
138
- def zone_number
139
- end
140
-
141
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The UTM class lets you work with UTM map coordinates.
5
+ #
6
+ # @note Valid ranges for {#zone_number} and {#zone_letter} are 1-60 and C-X
7
+ # (omitting I and O). Valid ranges for {#x} and {#y} are 100000-899999.
8
+ #
9
+ # @version SketchUp 6.0
10
+ class Geom::UTM
11
+
12
+ # Instance Methods
13
+
14
+ # The {#initialize} method is used to create a new UTM coordinate. You will
15
+ # often create UTM objects by calling the method {Sketchup::Model#point_to_utm}
16
+ # instead of calling this method.
17
+ #
18
+ # @example
19
+ # # Create a copy of an existing UTM object.
20
+ # utm = Geom::UTM.new(utm2)
21
+ #
22
+ # # Create a new UTM object from scratch.
23
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
24
+ #
25
+ # @overload initialize(zone_number, zone_letter, x, y)
26
+ #
27
+ # @param [Integer] zone_number A zone number or a UTM object.
28
+ # @param [String] zone_letter A zone letter.
29
+ # @param [Float] x The x position.
30
+ # @param [Float] y The y position.
31
+ #
32
+ # @overload initialize(utm)
33
+ #
34
+ # @param [Geom::UTM] utm A UTM object.
35
+ #
36
+ # @overload initialize(array)
37
+ #
38
+ # @param [Array(Integer, String, Float, Float)] An array containing the zone
39
+ # number, zone letter, x and y positions.
40
+ #
41
+ # @return [Geom::UTM]
42
+ #
43
+ # @version SketchUp 6.0
44
+ def initialize(*args)
45
+ end
46
+
47
+ # The {#to_a} method returns a UTM coordinate as a 4 element array. The Array
48
+ # elements are the zone number, the zone letter, the x coordinate and the y
49
+ # coordinate.
50
+ #
51
+ # @example
52
+ # # Create a new UTM object from scratch.
53
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
54
+ # a = utm.to_a
55
+ #
56
+ # @return [Array(Integer, String, Float, Float)]
57
+ #
58
+ # @version SketchUp 6.0
59
+ def to_a
60
+ end
61
+
62
+ # The {#to_latlong} method is used to convert UTM coordinates to latitude
63
+ # and longitude. See the LatLong class for more information.
64
+ #
65
+ # @example
66
+ # # Create a new UTM object from scratch.
67
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
68
+ # ll = utm.to_latlong
69
+ #
70
+ # @return [Geom::LatLong]
71
+ #
72
+ # @version SketchUp 6.0
73
+ def to_latlong
74
+ end
75
+
76
+ # The {#to_s} method is used to retrieve a string representation of a UTM.
77
+ #
78
+ # @example
79
+ # # Create a new UTM object from scratch.
80
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
81
+ # string = utm.to_s
82
+ #
83
+ # @return [String]
84
+ #
85
+ # @version SketchUp 6.0
86
+ def to_s
87
+ end
88
+
89
+ # The {#x} method returns the UTM x coordinate.
90
+ #
91
+ # @example
92
+ # # Create a new UTM object from scratch.
93
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
94
+ # x = utm.x
95
+ #
96
+ # @return [Float]
97
+ #
98
+ # @version SketchUp 6.0
99
+ def x
100
+ end
101
+
102
+ # The {#y} method returns the UTM y coordinate.
103
+ #
104
+ # @example
105
+ # # Create a new UTM object from scratch.
106
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
107
+ # y = utm.y
108
+ #
109
+ # @return [Float]
110
+ #
111
+ # @version SketchUp 6.0
112
+ def y
113
+ end
114
+
115
+ # The {#zone_letter} method returns the UTM zone letter.
116
+ #
117
+ # @example
118
+ # # Create a new UTM object from scratch.
119
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
120
+ # zl = utm.zone_letter
121
+ #
122
+ # @return [String]
123
+ #
124
+ # @version SketchUp 6.0
125
+ def zone_letter
126
+ end
127
+
128
+ # The {#zone_number} method returns the UTM zone number.
129
+ #
130
+ # @example
131
+ # # Create a new UTM object from scratch.
132
+ # utm = Geom::UTM.new(13, "T", 475849.37521, 4429682.73749)
133
+ # zn = utm.zone_number
134
+ #
135
+ # @return [Integer]
136
+ #
137
+ # @version SketchUp 6.0
138
+ def zone_number
139
+ end
140
+
141
+ end
@@ -1,523 +1,522 @@
1
- # Copyright:: Copyright 2019 Trimble Inc.
2
- # License:: The MIT License (MIT)
3
-
4
- # The Vector2d class represents vectors in a 2 dimensional space.
5
- # Vectors in LayOut have a direction and a length, but not a starting point.
6
- #
7
- # There are numerous tutorials on 2D vectors available on the internet.
8
- #
9
- # @version LayOut 2018
10
- class Geom::Vector2d
11
-
12
- # Instance Methods
13
-
14
- # The {#%} method returns the dot product between two {Geom::Vector2d}. This is
15
- # an alias of the dot method.
16
- #
17
- # @example
18
- # vector = Geom::Vector2d.new(0, 2)
19
- # vector2 = Geom::Vector2d.new(1, 0)
20
- # d2 = vector % vector2
21
- #
22
- # @param [Geom::Vector2d] vector
23
- #
24
- # @return The dot product of the vectors
25
- #
26
- # @version LayOut 2018
27
- def %(vector)
28
- end
29
-
30
- # The {#*} method returns the cross product between two {Geom::Vector2d}. This
31
- # is an alias of the cross method.
32
- #
33
- # @example
34
- # vector = Geom::Vector2d.new(1, 0)
35
- # vector2 = Geom::Vector2d.new(0, 1)
36
- # cross = vector * vector
37
- #
38
- # @param [Geom::Vector2d] vector
39
- #
40
- # @return [Geom::Vector2d]
41
- #
42
- # @version LayOut 2018
43
- def *(vector)
44
- end
45
-
46
- # The {#+} method adds a {Geom::Vector2d} to this one.
47
- #
48
- # @example
49
- # vector = Geom::Vector2d.new(0, 2)
50
- # vector2 = Geom::Vector2d.new(1, 0)
51
- # new_vector = vector + vector2
52
- #
53
- # @param [Geom::Vector2d] vector
54
- #
55
- # @return [Geom::Vector2d]
56
- #
57
- # @version LayOut 2018
58
- def +(vector)
59
- end
60
-
61
- # The {#-} method subtracts a {Geom::Vector2d} from this one.
62
- #
63
- # @example
64
- # vector = Geom::Vector2d.new(0, 2)
65
- # vector2 = Geom::Vector2d.new(1, 0)
66
- # new_vector = vector - vector2
67
- #
68
- # @param [Geom::Vector2d] vector
69
- #
70
- # @return [Geom::Vector2d]
71
- #
72
- # @version LayOut 2018
73
- def -(vector)
74
- end
75
-
76
- # The {#==} method returns whether two {Geom::Vector2d} are equal within
77
- # tolerance.
78
- #
79
- # @example
80
- # vector = Geom::Vector2d.new(1, 0)
81
- # vector2 = Geom::Vector2d.new(0,1)
82
- # # Returns false
83
- # status = vector == vector2
84
- #
85
- # @param [Geom::Vector2d] vector
86
- #
87
- # @return [Boolean]
88
- #
89
- # @version LayOut 2018
90
- def ==(vector)
91
- end
92
-
93
- # The {#[]} method returns the value of the {Geom::Vector2d} at the specified
94
- # index.
95
- #
96
- # @example
97
- # vector = Geom::Vector2d.new(1, 2)
98
- # # retrieves the y value of 2
99
- # yvalue = vector[1]
100
- #
101
- # @param [Integer] index
102
- # The index into an array of two coordinates.
103
- #
104
- # @return [Numeric] The value for the x or y coordinate.
105
- #
106
- # @version LayOut 2018
107
- def [](index)
108
- end
109
-
110
- # The {#[]=} method sets the x or y value of the {Geom::Vector2d} based on the
111
- # specific index of the value.
112
- #
113
- # @example
114
- # point = Geom::Vector2d.new(1,2)
115
- # point[1] = 4
116
- #
117
- # @param [Numeric] index
118
- # The index for a specific x or y value in the
119
- # {Geom::Vector2d} to set
120
- #
121
- # @param [Numeric] value
122
- # The value to set for x or y
123
- #
124
- # @return [Numeric] The new x or y value if successful
125
- #
126
- # @version LayOut 2018
127
- def []=(index, value)
128
- end
129
-
130
- # The {#angle_between} method computes the angle in radians between
131
- # the {Geom::Vector2d} and another {Geom::Vector2d}.
132
- #
133
- # @example
134
- # vector = Geom::Vector2d.new(1, 0)
135
- # vector2 = Geom::Vector2d.new(-1, 0)
136
- # # returns PI
137
- # angle = vector.angle_between(vector2)
138
- #
139
- # @param [Geom::Vector2d] vector
140
- #
141
- # @return [Numeric] The angle (in radians)
142
- #
143
- # @version LayOut 2018
144
- def angle_between(vector)
145
- end
146
-
147
- # The {#clone} method makes a copy of the {Geom::Vector2d}. This method is
148
- # equivalent to vec2 = Geom::Vector2d.new(vec).
149
- #
150
- # @example
151
- # vector = Geom::Vector2d.new(1, 0)
152
- # vector2 = vector.clone
153
- #
154
- # @return [Geom::Vector2d]
155
- #
156
- # @version LayOut 2018
157
- def clone
158
- end
159
-
160
- # The {#*} method returns the cross product between two {Geom::Vector2d}. This
161
- # is an alias of the cross method.
162
- #
163
- # @example
164
- # vector = Geom::Vector2d.new(1, 0)
165
- # vector2 = Geom::Vector2d.new(0, 1)
166
- # cross = vector * vector
167
- #
168
- # @param [Geom::Vector2d] vector
169
- #
170
- # @return [Geom::Vector2d]
171
- #
172
- # @version LayOut 2018
173
- def cross(vector)
174
- end
175
-
176
- # The {#%} method returns the dot product between two {Geom::Vector2d}. This is
177
- # an alias of the dot method.
178
- #
179
- # @example
180
- # vector = Geom::Vector2d.new(0, 2)
181
- # vector2 = Geom::Vector2d.new(1, 0)
182
- # d2 = vector % vector2
183
- #
184
- # @param [Geom::Vector2d] vector
185
- #
186
- # @return The dot product of the vectors
187
- #
188
- # @version LayOut 2018
189
- def dot(vector)
190
- end
191
-
192
- # The {.new} method creates a new {Geom::Vector2d}.
193
- #
194
- # @example
195
- # # A vector that runs along the X axis.
196
- # vector = Geom::Vector2d.new(1, 0)
197
- #
198
- # @overload initialize
199
- #
200
- # @return [Geom::Vector2d]
201
- #
202
- # @overload initialize(x, y)
203
- #
204
- # @param [Numeric] x The length in the x direction
205
- # @param [Numeric] y The length in the y direction
206
- # @return [Geom::Vector2d]
207
- #
208
- # @overload initialize(vector)
209
- #
210
- # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
211
- # @return [Geom::Vector2d]
212
- #
213
- # @version LayOut 2018
214
- def initialize(*args)
215
- end
216
-
217
- # The {#inspect} method formats the {Geom::Vector2d} as a string.
218
- #
219
- # @example
220
- # point = Geom::Point2d.new(1, 2)
221
- # string = point.inspect
222
- #
223
- # @return [String] the string representation of the {Geom::Vector2d}
224
- #
225
- # @version LayOut 2018
226
- def inspect
227
- end
228
-
229
- # The {#length} method returns the length of the {Geom::Vector2d}.
230
- #
231
- # @example
232
- # vector = Geom::Vector2d.new(0, 4)
233
- # # returns 4
234
- # l = vector.length
235
- #
236
- # @return [Length] The length of the {Geom::Vector2d}
237
- #
238
- # @version LayOut 2018
239
- def length
240
- end
241
-
242
- # The {#length=} method sets the length of the {Geom::Vector2d}. The new length
243
- # must not be 0.
244
- #
245
- # @example
246
- # vector = Geom::Vector2d.new(0, 4)
247
- # l = vector.length
248
- # vector.length = 2
249
- #
250
- # @param [Numeric] length
251
- # The new length for the {Geom::Vector2d}
252
- #
253
- # @return [Numeric] The new length
254
- #
255
- # @version LayOut 2018
256
- def length=(length)
257
- end
258
-
259
- # The {#normalize} method returns a {Geom::Vector2d} that is a unit vector
260
- # of the {Geom::Vector2d}.
261
- #
262
- # @example
263
- # vector = Geom::Vector2d.new(0, 4)
264
- # # returns a new Vector2d(0, 1)
265
- # vector2 = vector.normalize
266
- #
267
- # @return [Geom::Vector2d]
268
- #
269
- # @version LayOut 2018
270
- def normalize
271
- end
272
-
273
- # The {#normalize!} method converts a {Geom::Vector2d} vector into a unit
274
- # vector. Another way to do this is vector.length = 1
275
- #
276
- # @example
277
- # vector = Geom::Vector2d.new(0, 4)
278
- # # modifies vector to be the Vector2d(0, 1)
279
- # vector.normalize!
280
- #
281
- # @version LayOut 2018
282
- def normalize!
283
- end
284
-
285
- # The {#parallel?} method determines if the {Geom::Vector2d} is parallel to
286
- # another {Geom::Vector2d} to within tolerance.
287
- #
288
- # @example
289
- # vector = Geom::Vector2d.new(0, 1)
290
- # vector2 = Geom::Vector2d.new(1, 2)
291
- # # returns true
292
- # status = vector.parallel?(vector2)
293
- #
294
- # @param [Geom::Vector2d] vector
295
- #
296
- # @return [Boolean]
297
- #
298
- # @version LayOut 2018
299
- def parallel?(vector)
300
- end
301
-
302
- # The {#perpendicular?} method determines if the {Geom::Vector2d} is
303
- # perpendicular to another {Geom::Vector2d} to within tolerance.
304
- #
305
- # @example
306
- # vector = Geom::Vector2d.new(0, 1)
307
- # vector2 = Geom::Vector2d.new(1, 2)
308
- # # returns false
309
- # status = vector.perpendicular?(vector2)
310
- #
311
- # @param [Geom::Vector2d] vector
312
- #
313
- # @return [Boolean]
314
- #
315
- # @version LayOut 2018
316
- def perpendicular?(vector)
317
- end
318
-
319
- # The {#reverse} method returns a new {Geom::Vector2d} that is the reverse of
320
- # the {Geom::Vector2d}, leaving the original unchanged.
321
- #
322
- # @example
323
- # vector = Geom::Vector2d.new(1, 2)
324
- # # returns the Vector2d(-1, -2)
325
- # vector2 = vector.reverse
326
- #
327
- # @return [Geom::Vector2d]
328
- #
329
- # @version LayOut 2018
330
- def reverse
331
- end
332
-
333
- # The {#reverse!} method reverses the {Geom::Vector2d} in place.
334
- #
335
- # @example
336
- # vector = Geom::Vector2d.new(1, 2)
337
- # # modifies vector to be the Vector2d(-1, -2)
338
- # vector.reverse!
339
- #
340
- # @version LayOut 2018
341
- def reverse!
342
- end
343
-
344
- # The {#same_direction?} method determines if the {Geom::Vector2d} is parallel
345
- # to and in the same direction as another {Geom::Vector2d} within tolerance.
346
- #
347
- # @example
348
- # vector = Geom::Vector2d.new(0, 1)
349
- # vector2 = Geom::Vector2d.new(1, 2)
350
- # # returns true
351
- # status = vector.sime_direction?(vector2)
352
- #
353
- # @param [Geom::Vector2d] vector
354
- #
355
- # @return [Boolean]
356
- #
357
- # @version LayOut 2018
358
- def same_direction?(vector)
359
- end
360
-
361
- # The {#set!} method sets the values of the {Geom::Vector2d}.
362
- #
363
- # @example
364
- # vector = Geom::Vector2d.new(1, 2)
365
- # vector = vector.set!([4, 5])
366
- #
367
- # @overload set!(vector)
368
- #
369
- # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
370
- # @return [Geom::Vector2d]
371
- #
372
- # @overload set!(x, y)
373
- #
374
- # @param [Numeric] x
375
- # @param [Numeric] y
376
- # @return [Geom::Vector2d]
377
- #
378
- # @version LayOut 2018
379
- def set!(*args)
380
- end
381
-
382
- # The {#to_a} method retrieves the coordinates of the {Geom::Vector2d} in an
383
- # Array.
384
- #
385
- # @example
386
- # a = vector.to_a
387
- #
388
- # @return [Array(Numeric, Numeric)]
389
- #
390
- # @version LayOut 2018
391
- def to_a
392
- end
393
-
394
- # The {#to_s} method returns a string representation of the {Geom::Vector2d}.
395
- #
396
- # @example
397
- # point = Geom::Vector2d.new(1, 2)
398
- # str = point.to_s
399
- #
400
- # @return [String] the string representation of the {Geom::Vector2d}
401
- #
402
- # @version LayOut 2018
403
- def to_s
404
- end
405
-
406
- # The {#transform} method applies a transformation to a vector, returning a new
407
- # vector. The original vector is unchanged by this method.
408
- #
409
- # @example
410
- # vector = Geom::Vector2d.new(4, 5)
411
- # transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
412
- # # vector2 will be (6, 8)
413
- # vector2 = vector.transform(transformation)
414
- #
415
- # @param [Geom::Transformation2d] transform
416
- # A transformation object to apply to the vector.
417
- #
418
- # @return [Geom::Vector2d] the newly transformed vector
419
- #
420
- # @version LayOut 2019
421
- def transform(transform)
422
- end
423
-
424
- # The {#transform!} method applies a transformation to a vector. The vector
425
- # itself is modified.
426
- #
427
- # @example
428
- # vector = Geom::Vector2d.new(4, 5)
429
- # transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
430
- # # vector will be (6, 8)
431
- # vector.transform!(transformation)
432
- #
433
- # @param [Geom::Transformation2d] transform
434
- # A Transformation object to apply to the vector.
435
- #
436
- # @return [Geom::Vector2d] the transformed vector
437
- #
438
- # @version LayOut 2019
439
- def transform!(transform)
440
- end
441
-
442
- # The {#unit_vector?} method returns whether the {Geom::Vector2d} is a unit
443
- # vector. This is equivalent to vector.length == 1.0
444
- #
445
- # @example
446
- # vector = Geom::Vector2d.new(1, 0)
447
- # # returns true
448
- # status = vector.unit_vector
449
- #
450
- # @return [Boolean]
451
- #
452
- # @version LayOut 2018
453
- def unit_vector?
454
- end
455
-
456
- # The {#valid?} method verifies if a {Geom::Vector2d} is valid. A
457
- # {Geom::Vector2d} is valid if its length is not zero.
458
- #
459
- # @example
460
- # vector = Geom::Vector2d.new(0, 4)
461
- # status = vector.valid
462
- #
463
- # @return [Boolean]
464
- #
465
- # @version LayOut 2018
466
- def valid?
467
- end
468
-
469
- # The {#x} method retrieves the x value of the {Geom::Vector2d}.
470
- #
471
- # @example
472
- # vector = Geom::Vector2d.new(1, 2)
473
- # x = vector.x
474
- #
475
- # @return [Numeric]
476
- #
477
- # @version LayOut 2018
478
- def x
479
- end
480
-
481
- # The {#x=} method sets the x coordinate of the {Geom::Vector2d}.
482
- #
483
- # @example
484
- # vector = Geom::Vector2d.new(1, 2)
485
- # vector.x = 7
486
- #
487
- # @param [Numeric] x
488
- # The desired x value of the {Geom::Vector2d}
489
- #
490
- # @return [Numeric] The new x value of the {Geom::Vector2d}
491
- #
492
- # @version LayOut 2018
493
- def x=(x)
494
- end
495
-
496
- # The {#y} method retrieves the y value of the {Geom::Vector2d}.
497
- #
498
- # @example
499
- # vector = Geom::Vector2d.new(1, 2)
500
- # y = vector.y
501
- #
502
- # @return [Numeric]
503
- #
504
- # @version LayOut 2018
505
- def y
506
- end
507
-
508
- # The {#y=} method sets the y coordinate of the {Geom::Vector2d}.
509
- #
510
- # @example
511
- # vector = Geom::Vector2d.new(1, 2)
512
- # vector.y = 7
513
- #
514
- # @param [Numeric] y
515
- # The desired y value of the {Geom::Vector2d}
516
- #
517
- # @return [Numeric] The new y value of the {Geom::Vector2d}
518
- #
519
- # @version LayOut 2018
520
- def y=(y)
521
- end
522
-
523
- end
1
+ # Copyright:: Copyright 2020 Trimble Inc.
2
+ # License:: The MIT License (MIT)
3
+
4
+ # The {Geom::Vector2d} class represents vectors in a 2 dimensional space.
5
+ #
6
+ # There are numerous tutorials on 2D vectors available on the internet.
7
+ #
8
+ # @version LayOut 2018
9
+ class Geom::Vector2d
10
+
11
+ # Instance Methods
12
+
13
+ # The {#%} method returns the dot product between two {Geom::Vector2d}. This is
14
+ # an alias of the dot method.
15
+ #
16
+ # @example
17
+ # vector = Geom::Vector2d.new(0, 2)
18
+ # vector2 = Geom::Vector2d.new(1, 0)
19
+ # d2 = vector % vector2
20
+ #
21
+ # @param [Geom::Vector2d] vector
22
+ #
23
+ # @return The dot product of the vectors
24
+ #
25
+ # @version LayOut 2018
26
+ def %(vector)
27
+ end
28
+
29
+ # The {#*} method returns the cross product between two {Geom::Vector2d}. This
30
+ # is an alias of the cross method.
31
+ #
32
+ # @example
33
+ # vector = Geom::Vector2d.new(1, 0)
34
+ # vector2 = Geom::Vector2d.new(0, 1)
35
+ # cross = vector * vector
36
+ #
37
+ # @param [Geom::Vector2d] vector
38
+ #
39
+ # @return [Geom::Vector2d]
40
+ #
41
+ # @version LayOut 2018
42
+ def *(vector)
43
+ end
44
+
45
+ # The {#+} method adds a {Geom::Vector2d} to this one.
46
+ #
47
+ # @example
48
+ # vector = Geom::Vector2d.new(0, 2)
49
+ # vector2 = Geom::Vector2d.new(1, 0)
50
+ # new_vector = vector + vector2
51
+ #
52
+ # @param [Geom::Vector2d] vector
53
+ #
54
+ # @return [Geom::Vector2d]
55
+ #
56
+ # @version LayOut 2018
57
+ def +(vector)
58
+ end
59
+
60
+ # The {#-} method subtracts a {Geom::Vector2d} from this one.
61
+ #
62
+ # @example
63
+ # vector = Geom::Vector2d.new(0, 2)
64
+ # vector2 = Geom::Vector2d.new(1, 0)
65
+ # new_vector = vector - vector2
66
+ #
67
+ # @param [Geom::Vector2d] vector
68
+ #
69
+ # @return [Geom::Vector2d]
70
+ #
71
+ # @version LayOut 2018
72
+ def -(vector)
73
+ end
74
+
75
+ # The {#==} method returns whether two {Geom::Vector2d} are equal within
76
+ # tolerance.
77
+ #
78
+ # @example
79
+ # vector = Geom::Vector2d.new(1, 0)
80
+ # vector2 = Geom::Vector2d.new(0,1)
81
+ # # Returns false
82
+ # status = vector == vector2
83
+ #
84
+ # @param [Geom::Vector2d] vector
85
+ #
86
+ # @return [Boolean]
87
+ #
88
+ # @version LayOut 2018
89
+ def ==(vector)
90
+ end
91
+
92
+ # The {#[]} method returns the value of the {Geom::Vector2d} at the specified
93
+ # index.
94
+ #
95
+ # @example
96
+ # vector = Geom::Vector2d.new(1, 2)
97
+ # # retrieves the y value of 2
98
+ # yvalue = vector[1]
99
+ #
100
+ # @param [Integer] index
101
+ # The index into an array of two coordinates.
102
+ #
103
+ # @return [Numeric] The value for the x or y coordinate.
104
+ #
105
+ # @version LayOut 2018
106
+ def [](index)
107
+ end
108
+
109
+ # The {#[]=} method sets the x or y value of the {Geom::Vector2d} based on the
110
+ # specific index of the value.
111
+ #
112
+ # @example
113
+ # point = Geom::Vector2d.new(1,2)
114
+ # point[1] = 4
115
+ #
116
+ # @param [Numeric] index
117
+ # The index for a specific x or y value in the
118
+ # {Geom::Vector2d} to set
119
+ #
120
+ # @param [Numeric] value
121
+ # The value to set for x or y
122
+ #
123
+ # @return [Numeric] The new x or y value if successful
124
+ #
125
+ # @version LayOut 2018
126
+ def []=(index, value)
127
+ end
128
+
129
+ # The {#angle_between} method computes the angle in radians between
130
+ # the {Geom::Vector2d} and another {Geom::Vector2d}.
131
+ #
132
+ # @example
133
+ # vector = Geom::Vector2d.new(1, 0)
134
+ # vector2 = Geom::Vector2d.new(-1, 0)
135
+ # # returns PI
136
+ # angle = vector.angle_between(vector2)
137
+ #
138
+ # @param [Geom::Vector2d] vector
139
+ #
140
+ # @return [Numeric] The angle (in radians)
141
+ #
142
+ # @version LayOut 2018
143
+ def angle_between(vector)
144
+ end
145
+
146
+ # The {#clone} method makes a copy of the {Geom::Vector2d}. This method is
147
+ # equivalent to vec2 = Geom::Vector2d.new(vec).
148
+ #
149
+ # @example
150
+ # vector = Geom::Vector2d.new(1, 0)
151
+ # vector2 = vector.clone
152
+ #
153
+ # @return [Geom::Vector2d]
154
+ #
155
+ # @version LayOut 2018
156
+ def clone
157
+ end
158
+
159
+ # The {#*} method returns the cross product between two {Geom::Vector2d}. This
160
+ # is an alias of the cross method.
161
+ #
162
+ # @example
163
+ # vector = Geom::Vector2d.new(1, 0)
164
+ # vector2 = Geom::Vector2d.new(0, 1)
165
+ # cross = vector * vector
166
+ #
167
+ # @param [Geom::Vector2d] vector
168
+ #
169
+ # @return [Geom::Vector2d]
170
+ #
171
+ # @version LayOut 2018
172
+ def cross(vector)
173
+ end
174
+
175
+ # The {#%} method returns the dot product between two {Geom::Vector2d}. This is
176
+ # an alias of the dot method.
177
+ #
178
+ # @example
179
+ # vector = Geom::Vector2d.new(0, 2)
180
+ # vector2 = Geom::Vector2d.new(1, 0)
181
+ # d2 = vector % vector2
182
+ #
183
+ # @param [Geom::Vector2d] vector
184
+ #
185
+ # @return The dot product of the vectors
186
+ #
187
+ # @version LayOut 2018
188
+ def dot(vector)
189
+ end
190
+
191
+ # The {.new} method creates a new {Geom::Vector2d}.
192
+ #
193
+ # @example
194
+ # # A vector that runs along the X axis.
195
+ # vector = Geom::Vector2d.new(1, 0)
196
+ #
197
+ # @overload initialize
198
+ #
199
+ # @return [Geom::Vector2d]
200
+ #
201
+ # @overload initialize(x, y)
202
+ #
203
+ # @param [Numeric] x The length in the x direction
204
+ # @param [Numeric] y The length in the y direction
205
+ # @return [Geom::Vector2d]
206
+ #
207
+ # @overload initialize(vector)
208
+ #
209
+ # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
210
+ # @return [Geom::Vector2d]
211
+ #
212
+ # @version LayOut 2018
213
+ def initialize(*args)
214
+ end
215
+
216
+ # The {#inspect} method formats the {Geom::Vector2d} as a string.
217
+ #
218
+ # @example
219
+ # point = Geom::Point2d.new(1, 2)
220
+ # string = point.inspect
221
+ #
222
+ # @return [String] the string representation of the {Geom::Vector2d}
223
+ #
224
+ # @version LayOut 2018
225
+ def inspect
226
+ end
227
+
228
+ # The {#length} method returns the length of the {Geom::Vector2d}.
229
+ #
230
+ # @example
231
+ # vector = Geom::Vector2d.new(0, 4)
232
+ # # returns 4
233
+ # l = vector.length
234
+ #
235
+ # @return [Length] The length of the {Geom::Vector2d}
236
+ #
237
+ # @version LayOut 2018
238
+ def length
239
+ end
240
+
241
+ # The {#length=} method sets the length of the {Geom::Vector2d}. The new length
242
+ # must not be 0.
243
+ #
244
+ # @example
245
+ # vector = Geom::Vector2d.new(0, 4)
246
+ # l = vector.length
247
+ # vector.length = 2
248
+ #
249
+ # @param [Numeric] length
250
+ # The new length for the {Geom::Vector2d}
251
+ #
252
+ # @return [Numeric] The new length
253
+ #
254
+ # @version LayOut 2018
255
+ def length=(length)
256
+ end
257
+
258
+ # The {#normalize} method returns a {Geom::Vector2d} that is a unit vector
259
+ # of the {Geom::Vector2d}.
260
+ #
261
+ # @example
262
+ # vector = Geom::Vector2d.new(0, 4)
263
+ # # returns a new Vector2d(0, 1)
264
+ # vector2 = vector.normalize
265
+ #
266
+ # @return [Geom::Vector2d]
267
+ #
268
+ # @version LayOut 2018
269
+ def normalize
270
+ end
271
+
272
+ # The {#normalize!} method converts a {Geom::Vector2d} vector into a unit
273
+ # vector. Another way to do this is vector.length = 1
274
+ #
275
+ # @example
276
+ # vector = Geom::Vector2d.new(0, 4)
277
+ # # modifies vector to be the Vector2d(0, 1)
278
+ # vector.normalize!
279
+ #
280
+ # @version LayOut 2018
281
+ def normalize!
282
+ end
283
+
284
+ # The {#parallel?} method determines if the {Geom::Vector2d} is parallel to
285
+ # another {Geom::Vector2d} to within tolerance.
286
+ #
287
+ # @example
288
+ # vector = Geom::Vector2d.new(0, 1)
289
+ # vector2 = Geom::Vector2d.new(1, 2)
290
+ # # returns true
291
+ # status = vector.parallel?(vector2)
292
+ #
293
+ # @param [Geom::Vector2d] vector
294
+ #
295
+ # @return [Boolean]
296
+ #
297
+ # @version LayOut 2018
298
+ def parallel?(vector)
299
+ end
300
+
301
+ # The {#perpendicular?} method determines if the {Geom::Vector2d} is
302
+ # perpendicular to another {Geom::Vector2d} to within tolerance.
303
+ #
304
+ # @example
305
+ # vector = Geom::Vector2d.new(0, 1)
306
+ # vector2 = Geom::Vector2d.new(1, 2)
307
+ # # returns false
308
+ # status = vector.perpendicular?(vector2)
309
+ #
310
+ # @param [Geom::Vector2d] vector
311
+ #
312
+ # @return [Boolean]
313
+ #
314
+ # @version LayOut 2018
315
+ def perpendicular?(vector)
316
+ end
317
+
318
+ # The {#reverse} method returns a new {Geom::Vector2d} that is the reverse of
319
+ # the {Geom::Vector2d}, leaving the original unchanged.
320
+ #
321
+ # @example
322
+ # vector = Geom::Vector2d.new(1, 2)
323
+ # # returns the Vector2d(-1, -2)
324
+ # vector2 = vector.reverse
325
+ #
326
+ # @return [Geom::Vector2d]
327
+ #
328
+ # @version LayOut 2018
329
+ def reverse
330
+ end
331
+
332
+ # The {#reverse!} method reverses the {Geom::Vector2d} in place.
333
+ #
334
+ # @example
335
+ # vector = Geom::Vector2d.new(1, 2)
336
+ # # modifies vector to be the Vector2d(-1, -2)
337
+ # vector.reverse!
338
+ #
339
+ # @version LayOut 2018
340
+ def reverse!
341
+ end
342
+
343
+ # The {#same_direction?} method determines if the {Geom::Vector2d} is parallel
344
+ # to and in the same direction as another {Geom::Vector2d} within tolerance.
345
+ #
346
+ # @example
347
+ # vector = Geom::Vector2d.new(0, 1)
348
+ # vector2 = Geom::Vector2d.new(1, 2)
349
+ # # returns true
350
+ # status = vector.sime_direction?(vector2)
351
+ #
352
+ # @param [Geom::Vector2d] vector
353
+ #
354
+ # @return [Boolean]
355
+ #
356
+ # @version LayOut 2018
357
+ def same_direction?(vector)
358
+ end
359
+
360
+ # The {#set!} method sets the values of the {Geom::Vector2d}.
361
+ #
362
+ # @example
363
+ # vector = Geom::Vector2d.new(1, 2)
364
+ # vector = vector.set!([4, 5])
365
+ #
366
+ # @overload set!(vector)
367
+ #
368
+ # @param [Geom::Vector2d, Array(Numeric, Numeric)] vector
369
+ # @return [Geom::Vector2d]
370
+ #
371
+ # @overload set!(x, y)
372
+ #
373
+ # @param [Numeric] x
374
+ # @param [Numeric] y
375
+ # @return [Geom::Vector2d]
376
+ #
377
+ # @version LayOut 2018
378
+ def set!(*args)
379
+ end
380
+
381
+ # The {#to_a} method retrieves the coordinates of the {Geom::Vector2d} in an
382
+ # Array.
383
+ #
384
+ # @example
385
+ # a = vector.to_a
386
+ #
387
+ # @return [Array(Numeric, Numeric)]
388
+ #
389
+ # @version LayOut 2018
390
+ def to_a
391
+ end
392
+
393
+ # The {#to_s} method returns a string representation of the {Geom::Vector2d}.
394
+ #
395
+ # @example
396
+ # point = Geom::Vector2d.new(1, 2)
397
+ # str = point.to_s
398
+ #
399
+ # @return [String] the string representation of the {Geom::Vector2d}
400
+ #
401
+ # @version LayOut 2018
402
+ def to_s
403
+ end
404
+
405
+ # The {#transform} method applies a transformation to a vector, returning a new
406
+ # vector. The original vector is unchanged by this method.
407
+ #
408
+ # @example
409
+ # vector = Geom::Vector2d.new(4, 5)
410
+ # transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
411
+ # # vector2 will be (6, 8)
412
+ # vector2 = vector.transform(transformation)
413
+ #
414
+ # @param [Geom::Transformation2d] transform
415
+ # A transformation object to apply to the vector.
416
+ #
417
+ # @return [Geom::Vector2d] the newly transformed vector
418
+ #
419
+ # @version LayOut 2019
420
+ def transform(transform)
421
+ end
422
+
423
+ # The {#transform!} method applies a transformation to a vector. The vector
424
+ # itself is modified.
425
+ #
426
+ # @example
427
+ # vector = Geom::Vector2d.new(4, 5)
428
+ # transformation = Geom::Transformation2d.new([1, 0, 0, 1, 2, 3])
429
+ # # vector will be (6, 8)
430
+ # vector.transform!(transformation)
431
+ #
432
+ # @param [Geom::Transformation2d] transform
433
+ # A Transformation object to apply to the vector.
434
+ #
435
+ # @return [Geom::Vector2d] the transformed vector
436
+ #
437
+ # @version LayOut 2019
438
+ def transform!(transform)
439
+ end
440
+
441
+ # The {#unit_vector?} method returns whether the {Geom::Vector2d} is a unit
442
+ # vector. This is equivalent to vector.length == 1.0
443
+ #
444
+ # @example
445
+ # vector = Geom::Vector2d.new(1, 0)
446
+ # # returns true
447
+ # status = vector.unit_vector
448
+ #
449
+ # @return [Boolean]
450
+ #
451
+ # @version LayOut 2018
452
+ def unit_vector?
453
+ end
454
+
455
+ # The {#valid?} method verifies if a {Geom::Vector2d} is valid. A
456
+ # {Geom::Vector2d} is valid if its length is not zero.
457
+ #
458
+ # @example
459
+ # vector = Geom::Vector2d.new(0, 4)
460
+ # status = vector.valid
461
+ #
462
+ # @return [Boolean]
463
+ #
464
+ # @version LayOut 2018
465
+ def valid?
466
+ end
467
+
468
+ # The {#x} method retrieves the x value of the {Geom::Vector2d}.
469
+ #
470
+ # @example
471
+ # vector = Geom::Vector2d.new(1, 2)
472
+ # x = vector.x
473
+ #
474
+ # @return [Numeric]
475
+ #
476
+ # @version LayOut 2018
477
+ def x
478
+ end
479
+
480
+ # The {#x=} method sets the x coordinate of the {Geom::Vector2d}.
481
+ #
482
+ # @example
483
+ # vector = Geom::Vector2d.new(1, 2)
484
+ # vector.x = 7
485
+ #
486
+ # @param [Numeric] x
487
+ # The desired x value of the {Geom::Vector2d}
488
+ #
489
+ # @return [Numeric] The new x value of the {Geom::Vector2d}
490
+ #
491
+ # @version LayOut 2018
492
+ def x=(x)
493
+ end
494
+
495
+ # The {#y} method retrieves the y value of the {Geom::Vector2d}.
496
+ #
497
+ # @example
498
+ # vector = Geom::Vector2d.new(1, 2)
499
+ # y = vector.y
500
+ #
501
+ # @return [Numeric]
502
+ #
503
+ # @version LayOut 2018
504
+ def y
505
+ end
506
+
507
+ # The {#y=} method sets the y coordinate of the {Geom::Vector2d}.
508
+ #
509
+ # @example
510
+ # vector = Geom::Vector2d.new(1, 2)
511
+ # vector.y = 7
512
+ #
513
+ # @param [Numeric] y
514
+ # The desired y value of the {Geom::Vector2d}
515
+ #
516
+ # @return [Numeric] The new y value of the {Geom::Vector2d}
517
+ #
518
+ # @version LayOut 2018
519
+ def y=(y)
520
+ end
521
+
522
+ end