001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005// THIS FILE WAS AUTO-GENERATED BY ./wpiunits/generate_units.py. DO NOT MODIFY
006
007package edu.wpi.first.units.measure;
008
009import static edu.wpi.first.units.Units.*;
010import edu.wpi.first.units.*;
011
012@SuppressWarnings({"unchecked", "cast", "checkstyle", "PMD"})
013public interface Angle extends Measure<AngleUnit> {
014  static  Angle ofRelativeUnits(double magnitude, AngleUnit unit) {
015    return new ImmutableAngle(magnitude, unit.toBaseUnits(magnitude), unit);
016  }
017
018  static  Angle ofBaseUnits(double baseUnitMagnitude, AngleUnit unit) {
019    return new ImmutableAngle(unit.fromBaseUnits(baseUnitMagnitude), baseUnitMagnitude, unit);
020  }
021
022  @Override
023  Angle copy();
024
025  @Override
026  default MutAngle mutableCopy() {
027    return new MutAngle(magnitude(), baseUnitMagnitude(), unit());
028  }
029
030  @Override
031  AngleUnit unit();
032
033  @Override
034  default AngleUnit baseUnit() { return (AngleUnit) unit().getBaseUnit(); }
035
036  @Override
037  default double in(AngleUnit unit) {
038    return unit.fromBaseUnits(baseUnitMagnitude());
039  }
040
041  @Override
042  default Angle unaryMinus() {
043    return (Angle) unit().ofBaseUnits(0 - baseUnitMagnitude());
044  }
045
046  /**
047  * {@inheritDoc}
048  *
049  * @deprecated use unaryMinus() instead. This was renamed for consistency with other WPILib classes like Rotation2d
050  */
051  @Override
052  @Deprecated(since = "2025", forRemoval = true)
053  @SuppressWarnings({"deprecation", "removal"})
054  default Angle negate() {
055    return (Angle) unaryMinus();
056  }
057
058  @Override
059  default Angle plus(Measure<? extends AngleUnit> other) {
060    return (Angle) unit().ofBaseUnits(baseUnitMagnitude() + other.baseUnitMagnitude());
061  }
062
063  @Override
064  default Angle minus(Measure<? extends AngleUnit> other) {
065    return (Angle) unit().ofBaseUnits(baseUnitMagnitude() - other.baseUnitMagnitude());
066  }
067
068  @Override
069  default Angle times(double multiplier) {
070    return (Angle) unit().ofBaseUnits(baseUnitMagnitude() * multiplier);
071  }
072
073  @Override
074  default Angle div(double divisor) {
075    return (Angle) unit().ofBaseUnits(baseUnitMagnitude() / divisor);
076  }
077
078  /**
079  * {@inheritDoc}
080  *
081  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
082  */
083  @Override
084  @Deprecated(since = "2025", forRemoval = true)
085  @SuppressWarnings({"deprecation", "removal"})
086  default Angle divide(double divisor) {
087    return (Angle) div(divisor);
088  }
089
090  @Override
091  default AngularVelocity per(TimeUnit period) {
092    return div(period.of(1));
093  }
094
095
096  @Override
097  default Mult<AngleUnit, AccelerationUnit<?>> times(Acceleration<?> multiplier) {
098    return (Mult<AngleUnit, AccelerationUnit<?>>) Measure.super.times(multiplier);
099  }
100
101  @Override
102  default Per<AngleUnit, AccelerationUnit<?>> div(Acceleration<?> divisor) {
103    return (Per<AngleUnit, AccelerationUnit<?>>) Measure.super.div(divisor);
104  }
105
106  /**
107  * {@inheritDoc}
108  *
109  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
110  */
111  @Deprecated(since = "2025", forRemoval = true)
112  @SuppressWarnings({"deprecation", "removal"})
113  @Override
114  default Per<AngleUnit, AccelerationUnit<?>> divide(Acceleration<?> divisor) {
115    return div(divisor);
116  }
117
118
119  @Override
120  default Mult<AngleUnit, AngleUnit> times(Angle multiplier) {
121    return (Mult<AngleUnit, AngleUnit>) Measure.super.times(multiplier);
122  }
123
124  @Override
125  default Dimensionless div(Angle divisor) {
126    return Value.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
127  }
128
129  /**
130  * {@inheritDoc}
131  *
132  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
133  */
134  @Deprecated(since = "2025", forRemoval = true)
135  @SuppressWarnings({"deprecation", "removal"})
136  @Override
137  default Dimensionless divide(Angle divisor) {
138    return div(divisor);
139  }
140
141
142  @Override
143  default Mult<AngleUnit, AngularAccelerationUnit> times(AngularAcceleration multiplier) {
144    return (Mult<AngleUnit, AngularAccelerationUnit>) Measure.super.times(multiplier);
145  }
146
147  @Override
148  default Per<AngleUnit, AngularAccelerationUnit> div(AngularAcceleration divisor) {
149    return (Per<AngleUnit, AngularAccelerationUnit>) Measure.super.div(divisor);
150  }
151
152  /**
153  * {@inheritDoc}
154  *
155  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
156  */
157  @Deprecated(since = "2025", forRemoval = true)
158  @SuppressWarnings({"deprecation", "removal"})
159  @Override
160  default Per<AngleUnit, AngularAccelerationUnit> divide(AngularAcceleration divisor) {
161    return div(divisor);
162  }
163
164
165  @Override
166  default Mult<AngleUnit, AngularMomentumUnit> times(AngularMomentum multiplier) {
167    return (Mult<AngleUnit, AngularMomentumUnit>) Measure.super.times(multiplier);
168  }
169
170  @Override
171  default Per<AngleUnit, AngularMomentumUnit> div(AngularMomentum divisor) {
172    return (Per<AngleUnit, AngularMomentumUnit>) Measure.super.div(divisor);
173  }
174
175  /**
176  * {@inheritDoc}
177  *
178  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
179  */
180  @Deprecated(since = "2025", forRemoval = true)
181  @SuppressWarnings({"deprecation", "removal"})
182  @Override
183  default Per<AngleUnit, AngularMomentumUnit> divide(AngularMomentum divisor) {
184    return div(divisor);
185  }
186
187
188  @Override
189  default Mult<AngleUnit, AngularVelocityUnit> times(AngularVelocity multiplier) {
190    return (Mult<AngleUnit, AngularVelocityUnit>) Measure.super.times(multiplier);
191  }
192
193  @Override
194  default Per<AngleUnit, AngularVelocityUnit> div(AngularVelocity divisor) {
195    return (Per<AngleUnit, AngularVelocityUnit>) Measure.super.div(divisor);
196  }
197
198  /**
199  * {@inheritDoc}
200  *
201  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
202  */
203  @Deprecated(since = "2025", forRemoval = true)
204  @SuppressWarnings({"deprecation", "removal"})
205  @Override
206  default Per<AngleUnit, AngularVelocityUnit> divide(AngularVelocity divisor) {
207    return div(divisor);
208  }
209
210
211  @Override
212  default Mult<AngleUnit, CurrentUnit> times(Current multiplier) {
213    return (Mult<AngleUnit, CurrentUnit>) Measure.super.times(multiplier);
214  }
215
216  @Override
217  default Per<AngleUnit, CurrentUnit> div(Current divisor) {
218    return (Per<AngleUnit, CurrentUnit>) Measure.super.div(divisor);
219  }
220
221  /**
222  * {@inheritDoc}
223  *
224  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
225  */
226  @Deprecated(since = "2025", forRemoval = true)
227  @SuppressWarnings({"deprecation", "removal"})
228  @Override
229  default Per<AngleUnit, CurrentUnit> divide(Current divisor) {
230    return div(divisor);
231  }
232
233  @Override
234  default Angle div(Dimensionless divisor) {
235    return (Angle) Radians.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
236  }
237
238  /**
239  * {@inheritDoc}
240  *
241  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
242  */
243  @Override
244  @Deprecated(since = "2025", forRemoval = true)
245  @SuppressWarnings({"deprecation", "removal"})
246  default Angle divide(Dimensionless divisor) {
247    return (Angle) div(divisor);
248  }
249
250  @Override
251  default Angle times(Dimensionless multiplier) {
252    return (Angle) Radians.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
253  }
254
255
256  @Override
257  default Mult<AngleUnit, DistanceUnit> times(Distance multiplier) {
258    return (Mult<AngleUnit, DistanceUnit>) Measure.super.times(multiplier);
259  }
260
261  @Override
262  default Per<AngleUnit, DistanceUnit> div(Distance divisor) {
263    return (Per<AngleUnit, DistanceUnit>) Measure.super.div(divisor);
264  }
265
266  /**
267  * {@inheritDoc}
268  *
269  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
270  */
271  @Deprecated(since = "2025", forRemoval = true)
272  @SuppressWarnings({"deprecation", "removal"})
273  @Override
274  default Per<AngleUnit, DistanceUnit> divide(Distance divisor) {
275    return div(divisor);
276  }
277
278
279  @Override
280  default Mult<AngleUnit, EnergyUnit> times(Energy multiplier) {
281    return (Mult<AngleUnit, EnergyUnit>) Measure.super.times(multiplier);
282  }
283
284  @Override
285  default Per<AngleUnit, EnergyUnit> div(Energy divisor) {
286    return (Per<AngleUnit, EnergyUnit>) Measure.super.div(divisor);
287  }
288
289  /**
290  * {@inheritDoc}
291  *
292  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
293  */
294  @Deprecated(since = "2025", forRemoval = true)
295  @SuppressWarnings({"deprecation", "removal"})
296  @Override
297  default Per<AngleUnit, EnergyUnit> divide(Energy divisor) {
298    return div(divisor);
299  }
300
301
302  @Override
303  default Mult<AngleUnit, ForceUnit> times(Force multiplier) {
304    return (Mult<AngleUnit, ForceUnit>) Measure.super.times(multiplier);
305  }
306
307  @Override
308  default Per<AngleUnit, ForceUnit> div(Force divisor) {
309    return (Per<AngleUnit, ForceUnit>) Measure.super.div(divisor);
310  }
311
312  /**
313  * {@inheritDoc}
314  *
315  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
316  */
317  @Deprecated(since = "2025", forRemoval = true)
318  @SuppressWarnings({"deprecation", "removal"})
319  @Override
320  default Per<AngleUnit, ForceUnit> divide(Force divisor) {
321    return div(divisor);
322  }
323
324
325  @Override
326  default AngularVelocity times(Frequency multiplier) {
327    return RadiansPerSecond.of(baseUnitMagnitude() * multiplier.baseUnitMagnitude());
328  }
329
330  @Override
331  default Per<AngleUnit, FrequencyUnit> div(Frequency divisor) {
332    return (Per<AngleUnit, FrequencyUnit>) Measure.super.div(divisor);
333  }
334
335  /**
336  * {@inheritDoc}
337  *
338  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
339  */
340  @Deprecated(since = "2025", forRemoval = true)
341  @SuppressWarnings({"deprecation", "removal"})
342  @Override
343  default Per<AngleUnit, FrequencyUnit> divide(Frequency divisor) {
344    return div(divisor);
345  }
346
347
348  @Override
349  default Mult<AngleUnit, LinearAccelerationUnit> times(LinearAcceleration multiplier) {
350    return (Mult<AngleUnit, LinearAccelerationUnit>) Measure.super.times(multiplier);
351  }
352
353  @Override
354  default Per<AngleUnit, LinearAccelerationUnit> div(LinearAcceleration divisor) {
355    return (Per<AngleUnit, LinearAccelerationUnit>) Measure.super.div(divisor);
356  }
357
358  /**
359  * {@inheritDoc}
360  *
361  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
362  */
363  @Deprecated(since = "2025", forRemoval = true)
364  @SuppressWarnings({"deprecation", "removal"})
365  @Override
366  default Per<AngleUnit, LinearAccelerationUnit> divide(LinearAcceleration divisor) {
367    return div(divisor);
368  }
369
370
371  @Override
372  default Mult<AngleUnit, LinearMomentumUnit> times(LinearMomentum multiplier) {
373    return (Mult<AngleUnit, LinearMomentumUnit>) Measure.super.times(multiplier);
374  }
375
376  @Override
377  default Per<AngleUnit, LinearMomentumUnit> div(LinearMomentum divisor) {
378    return (Per<AngleUnit, LinearMomentumUnit>) Measure.super.div(divisor);
379  }
380
381  /**
382  * {@inheritDoc}
383  *
384  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
385  */
386  @Deprecated(since = "2025", forRemoval = true)
387  @SuppressWarnings({"deprecation", "removal"})
388  @Override
389  default Per<AngleUnit, LinearMomentumUnit> divide(LinearMomentum divisor) {
390    return div(divisor);
391  }
392
393
394  @Override
395  default Mult<AngleUnit, LinearVelocityUnit> times(LinearVelocity multiplier) {
396    return (Mult<AngleUnit, LinearVelocityUnit>) Measure.super.times(multiplier);
397  }
398
399  @Override
400  default Per<AngleUnit, LinearVelocityUnit> div(LinearVelocity divisor) {
401    return (Per<AngleUnit, LinearVelocityUnit>) Measure.super.div(divisor);
402  }
403
404  /**
405  * {@inheritDoc}
406  *
407  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
408  */
409  @Deprecated(since = "2025", forRemoval = true)
410  @SuppressWarnings({"deprecation", "removal"})
411  @Override
412  default Per<AngleUnit, LinearVelocityUnit> divide(LinearVelocity divisor) {
413    return div(divisor);
414  }
415
416
417  @Override
418  default Mult<AngleUnit, MassUnit> times(Mass multiplier) {
419    return (Mult<AngleUnit, MassUnit>) Measure.super.times(multiplier);
420  }
421
422  @Override
423  default Per<AngleUnit, MassUnit> div(Mass divisor) {
424    return (Per<AngleUnit, MassUnit>) Measure.super.div(divisor);
425  }
426
427  /**
428  * {@inheritDoc}
429  *
430  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
431  */
432  @Deprecated(since = "2025", forRemoval = true)
433  @SuppressWarnings({"deprecation", "removal"})
434  @Override
435  default Per<AngleUnit, MassUnit> divide(Mass divisor) {
436    return div(divisor);
437  }
438
439
440  @Override
441  default Mult<AngleUnit, MomentOfInertiaUnit> times(MomentOfInertia multiplier) {
442    return (Mult<AngleUnit, MomentOfInertiaUnit>) Measure.super.times(multiplier);
443  }
444
445  @Override
446  default Per<AngleUnit, MomentOfInertiaUnit> div(MomentOfInertia divisor) {
447    return (Per<AngleUnit, MomentOfInertiaUnit>) Measure.super.div(divisor);
448  }
449
450  /**
451  * {@inheritDoc}
452  *
453  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
454  */
455  @Deprecated(since = "2025", forRemoval = true)
456  @SuppressWarnings({"deprecation", "removal"})
457  @Override
458  default Per<AngleUnit, MomentOfInertiaUnit> divide(MomentOfInertia divisor) {
459    return div(divisor);
460  }
461
462
463  @Override
464  default Mult<AngleUnit, MultUnit<?, ?>> times(Mult<?, ?> multiplier) {
465    return (Mult<AngleUnit, MultUnit<?, ?>>) Measure.super.times(multiplier);
466  }
467
468  @Override
469  default Per<AngleUnit, MultUnit<?, ?>> div(Mult<?, ?> divisor) {
470    return (Per<AngleUnit, MultUnit<?, ?>>) Measure.super.div(divisor);
471  }
472
473  /**
474  * {@inheritDoc}
475  *
476  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
477  */
478  @Deprecated(since = "2025", forRemoval = true)
479  @SuppressWarnings({"deprecation", "removal"})
480  @Override
481  default Per<AngleUnit, MultUnit<?, ?>> divide(Mult<?, ?> divisor) {
482    return div(divisor);
483  }
484
485
486  @Override
487  default Mult<AngleUnit, PerUnit<?, ?>> times(Per<?, ?> multiplier) {
488    return (Mult<AngleUnit, PerUnit<?, ?>>) Measure.super.times(multiplier);
489  }
490
491  @Override
492  default Per<AngleUnit, PerUnit<?, ?>> div(Per<?, ?> divisor) {
493    return (Per<AngleUnit, PerUnit<?, ?>>) Measure.super.div(divisor);
494  }
495
496  /**
497  * {@inheritDoc}
498  *
499  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
500  */
501  @Deprecated(since = "2025", forRemoval = true)
502  @SuppressWarnings({"deprecation", "removal"})
503  @Override
504  default Per<AngleUnit, PerUnit<?, ?>> divide(Per<?, ?> divisor) {
505    return div(divisor);
506  }
507
508
509  @Override
510  default Mult<AngleUnit, PowerUnit> times(Power multiplier) {
511    return (Mult<AngleUnit, PowerUnit>) Measure.super.times(multiplier);
512  }
513
514  @Override
515  default Per<AngleUnit, PowerUnit> div(Power divisor) {
516    return (Per<AngleUnit, PowerUnit>) Measure.super.div(divisor);
517  }
518
519  /**
520  * {@inheritDoc}
521  *
522  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
523  */
524  @Deprecated(since = "2025", forRemoval = true)
525  @SuppressWarnings({"deprecation", "removal"})
526  @Override
527  default Per<AngleUnit, PowerUnit> divide(Power divisor) {
528    return div(divisor);
529  }
530
531
532  @Override
533  default Mult<AngleUnit, ResistanceUnit> times(Resistance multiplier) {
534    return (Mult<AngleUnit, ResistanceUnit>) Measure.super.times(multiplier);
535  }
536
537  @Override
538  default Per<AngleUnit, ResistanceUnit> div(Resistance divisor) {
539    return (Per<AngleUnit, ResistanceUnit>) Measure.super.div(divisor);
540  }
541
542  /**
543  * {@inheritDoc}
544  *
545  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
546  */
547  @Deprecated(since = "2025", forRemoval = true)
548  @SuppressWarnings({"deprecation", "removal"})
549  @Override
550  default Per<AngleUnit, ResistanceUnit> divide(Resistance divisor) {
551    return div(divisor);
552  }
553
554
555  @Override
556  default Mult<AngleUnit, TemperatureUnit> times(Temperature multiplier) {
557    return (Mult<AngleUnit, TemperatureUnit>) Measure.super.times(multiplier);
558  }
559
560  @Override
561  default Per<AngleUnit, TemperatureUnit> div(Temperature divisor) {
562    return (Per<AngleUnit, TemperatureUnit>) Measure.super.div(divisor);
563  }
564
565  /**
566  * {@inheritDoc}
567  *
568  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
569  */
570  @Deprecated(since = "2025", forRemoval = true)
571  @SuppressWarnings({"deprecation", "removal"})
572  @Override
573  default Per<AngleUnit, TemperatureUnit> divide(Temperature divisor) {
574    return div(divisor);
575  }
576
577
578  @Override
579  default Mult<AngleUnit, TimeUnit> times(Time multiplier) {
580    return (Mult<AngleUnit, TimeUnit>) Measure.super.times(multiplier);
581  }
582
583  @Override
584  default AngularVelocity div(Time divisor) {
585    return RadiansPerSecond.of(baseUnitMagnitude() / divisor.baseUnitMagnitude());
586  }
587
588  /**
589  * {@inheritDoc}
590  *
591  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
592  */
593  @Override
594  @Deprecated(since = "2025", forRemoval = true)
595  @SuppressWarnings({"deprecation", "removal"})
596  default AngularVelocity divide(Time divisor) {
597    return div(divisor);
598  }
599
600
601  @Override
602  default Mult<AngleUnit, TorqueUnit> times(Torque multiplier) {
603    return (Mult<AngleUnit, TorqueUnit>) Measure.super.times(multiplier);
604  }
605
606  @Override
607  default Per<AngleUnit, TorqueUnit> div(Torque divisor) {
608    return (Per<AngleUnit, TorqueUnit>) Measure.super.div(divisor);
609  }
610
611  /**
612  * {@inheritDoc}
613  *
614  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
615  */
616  @Deprecated(since = "2025", forRemoval = true)
617  @SuppressWarnings({"deprecation", "removal"})
618  @Override
619  default Per<AngleUnit, TorqueUnit> divide(Torque divisor) {
620    return div(divisor);
621  }
622
623
624  @Override
625  default Mult<AngleUnit, VelocityUnit<?>> times(Velocity<?> multiplier) {
626    return (Mult<AngleUnit, VelocityUnit<?>>) Measure.super.times(multiplier);
627  }
628
629  @Override
630  default Per<AngleUnit, VelocityUnit<?>> div(Velocity<?> divisor) {
631    return (Per<AngleUnit, VelocityUnit<?>>) Measure.super.div(divisor);
632  }
633
634  /**
635  * {@inheritDoc}
636  *
637  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
638  */
639  @Deprecated(since = "2025", forRemoval = true)
640  @SuppressWarnings({"deprecation", "removal"})
641  @Override
642  default Per<AngleUnit, VelocityUnit<?>> divide(Velocity<?> divisor) {
643    return div(divisor);
644  }
645
646
647  @Override
648  default Mult<AngleUnit, VoltageUnit> times(Voltage multiplier) {
649    return (Mult<AngleUnit, VoltageUnit>) Measure.super.times(multiplier);
650  }
651
652  @Override
653  default Per<AngleUnit, VoltageUnit> div(Voltage divisor) {
654    return (Per<AngleUnit, VoltageUnit>) Measure.super.div(divisor);
655  }
656
657  /**
658  * {@inheritDoc}
659  *
660  * @deprecated use div instead. This was renamed for consistency with other languages like Kotlin
661  */
662  @Deprecated(since = "2025", forRemoval = true)
663  @SuppressWarnings({"deprecation", "removal"})
664  @Override
665  default Per<AngleUnit, VoltageUnit> divide(Voltage divisor) {
666    return div(divisor);
667  }
668
669}