• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

google / vector_math.dart / 17181727464

04 Aug 2025 07:19PM UTC coverage: 26.702% (+0.3%) from 26.388%
17181727464

push

github

web-flow
Bump min SDK to 3.7, update dependencies, reformat (#348)

496 of 1182 new or added lines in 55 files covered. (41.96%)

18 existing lines in 8 files now uncovered.

4463 of 16714 relevant lines covered (26.7%)

1.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/lib/src/vector_math/plane.dart
1
// Copyright (c) 2015, Google Inc. Please see the AUTHORS file for details.
2
// All rights reserved. Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4

5
part of '../../vector_math.dart';
6

7
class Plane {
8
  final Vector3 _normal;
9
  double constant;
10

11
  /// Find the intersection point between the three planes [a], [b] and [c] and
12
  /// copy it into [result].
13
  static void intersection(Plane a, Plane b, Plane c, Vector3 result) {
2✔
14
    final cross = Vector3.zero();
2✔
15

16
    b.normal.crossInto(c.normal, cross);
6✔
17

18
    final f = -a.normal.dot(cross);
6✔
19

20
    final v1 = cross.scaled(a.constant);
4✔
21

22
    c.normal.crossInto(a.normal, cross);
6✔
23

24
    final v2 = cross.scaled(b.constant);
4✔
25

26
    a.normal.crossInto(b.normal, cross);
6✔
27

28
    final v3 = cross.scaled(c.constant);
4✔
29

30
    result
31
      ..x = (v1.x + v2.x + v3.x) / f
14✔
32
      ..y = (v1.y + v2.y + v3.y) / f
14✔
33
      ..z = (v1.z + v2.z + v3.z) / f;
14✔
34
  }
35

36
  Vector3 get normal => _normal;
8✔
37

38
  Plane() : _normal = Vector3.zero(), constant = 0.0;
6✔
39

40
  Plane.copy(Plane other)
×
NEW
41
    : _normal = Vector3.copy(other._normal),
×
NEW
42
      constant = other.constant;
×
43

44
  Plane.components(double x, double y, double z, this.constant)
×
NEW
45
    : _normal = Vector3(x, y, z);
×
46

47
  Plane.normalconstant(Vector3 normal_, this.constant)
2✔
48
    : _normal = Vector3.copy(normal_);
2✔
49

50
  void copyFrom(Plane o) {
×
51
    _normal.setFrom(o._normal);
×
52
    constant = o.constant;
×
53
  }
54

55
  void setFromComponents(double x, double y, double z, double w) {
1✔
56
    _normal.setValues(x, y, z);
2✔
57
    constant = w;
1✔
58
  }
59

60
  void normalize() {
2✔
61
    final inverseLength = 1.0 / normal.length;
6✔
62
    _normal.scale(inverseLength);
4✔
63
    constant *= inverseLength;
4✔
64
  }
65

66
  double distanceToVector3(Vector3 point) => _normal.dot(point) + constant;
10✔
67
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc