• 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

0.0
/lib/src/vector_math_64/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_64.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) {
×
14
    final cross = Vector3.zero();
×
15

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

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

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

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

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

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

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

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

36
  Vector3 get normal => _normal;
×
37

NEW
38
  Plane() : _normal = Vector3.zero(), constant = 0.0;
×
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)
×
NEW
48
    : _normal = Vector3.copy(normal_);
×
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) {
×
56
    _normal.setValues(x, y, z);
×
57
    constant = w;
×
58
  }
59

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

66
  double distanceToVector3(Vector3 point) => _normal.dot(point) + constant;
×
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