tv_mount_planner 0.1.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1ad02291d904618a88f88d63e09656b8fc36134d2e9db53dd5d8a7090e7d24d6
4
+ data.tar.gz: 3e34204869fdddad741f3d213d150a576c6df6158ffe7d920482ead1bc5d3ec9
5
+ SHA512:
6
+ metadata.gz: 479198008da4a6699a2a1858dd0f3b4211ace9bbaab8e9a4037c7fcc9f6e1bcce3d8ecc18e5ce2d52c56138c68a5ddf9ebdf4d9462bdb3a23daa01556b78c569
7
+ data.tar.gz: 42f1fd8edd566346792fe4aa54811a63e1749d01d13911536ce8d674161e38013bda4a9006cc3998221501c5c1096884c872bae948f8dd62b9d08b44460119d6
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Santa Clarita TV Mounting
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # tv_mount_planner
2
+
3
+ Tiny, dependency-free Ruby library and CLI for planning a wall-mounted TV: screen width/height from the diagonal (16:9), the screen-center height, the vertical viewing angle from your seat, and a bracket-rating target of 1.5 × the TV's weight.
4
+
5
+ ```
6
+ gem install tv_mount_planner
7
+ tv_mount_planner --diagonal 65 --weight 55 --eye 42 --distance 108
8
+ tv_mount_planner --diagonal 65 --weight 55 --eye 42 --distance 72 --fireplace 54 --gap 6
9
+ ```
10
+
11
+ ```ruby
12
+ require "tv_mount_planner"
13
+ r = TvMountPlanner.plan(diagonal: 65, weight_lb: 55, eye: 42, distance: 108)
14
+ r.center # => 42.0
15
+ r.angle_center # => 0.0
16
+ r.bracket_rating_lb # => 83
17
+ ```
18
+
19
+ Reference ranges (screen center 42–48 in from the floor for seated viewing on a plain wall; bottom edge typically 4–12 in above a mantel; comfortable vertical angle within about 15°; bracket rated at least 1.5× TV weight) follow the guides of [Santa Clarita TV Mounting](https://santaclaritatvmounting.com/), an independent local installer in Santa Clarita, CA (not licensed under the California Contractors State License Law).
20
+
21
+ This is a planning aid, not a quote and not an engineering check. The TV's weight and VESA pattern are on the label on its back.
22
+
23
+ MIT licensed.
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+ require "optparse"
3
+ require_relative "../lib/tv_mount_planner"
4
+
5
+ o = { diagonal: 65, weight_lb: 55, eye: 42.0, distance: 108, mode: :wall, mantel: 54.0, gap: 6.0 }
6
+ OptionParser.new do |p|
7
+ p.banner = "Usage: tv_mount_planner [options]"
8
+ p.on("--diagonal IN", Float, "TV diagonal in inches (65)") { |v| o[:diagonal] = v }
9
+ p.on("--weight LB", Float, "TV weight in pounds (55)") { |v| o[:weight_lb] = v }
10
+ p.on("--eye IN", Float, "seated eye height in inches (42)") { |v| o[:eye] = v }
11
+ p.on("--distance IN", Float, "seat-to-wall distance in inches (108)") { |v| o[:distance] = v }
12
+ p.on("--fireplace MANTEL_IN", Float, "mount above a mantel at this height") { |v| o[:mode] = :fireplace; o[:mantel] = v }
13
+ p.on("--gap IN", Float, "gap from mantel to TV bottom (6)") { |v| o[:gap] = v }
14
+ end.parse!
15
+
16
+ r = TvMountPlanner.plan(**o)
17
+ f = ->(x) { format("%.1f", x) }
18
+ puts "Screen (16:9): #{f.(r.width)} x #{f.(r.height)} in"
19
+ puts "Center from floor: #{f.(r.center)} in (bottom #{f.(r.bottom)}, top #{f.(r.top)})"
20
+ puts "Angle to center: #{f.(r.angle_center)} deg (top #{f.(r.angle_top)}, bottom #{f.(r.angle_bottom)}) -> #{r.comfortable ? 'within' : 'beyond'} about 15 deg"
21
+ puts "Bracket rating: at least #{r.bracket_rating_lb} lb (1.5 x TV weight)"
22
+ puts "Planning aid only; not a quote or an engineering check."
@@ -0,0 +1,3 @@
1
+ module TvMountPlanner
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,44 @@
1
+ require_relative "tv_mount_planner/version"
2
+
3
+ # Planning math for a wall-mounted TV. All lengths in inches, angles in degrees.
4
+ module TvMountPlanner
5
+ # Seated screen-center range for a plain wall, inches from the floor.
6
+ WALL_CENTER_RANGE = (42.0..48.0)
7
+ # Vertical angle (degrees) from the line of sight that is still considered comfortable.
8
+ COMFORT_ANGLE = 15.0
9
+ # Bracket rating target as a multiple of TV weight.
10
+ RATING_FACTOR = 1.5
11
+
12
+ Result = Struct.new(:width, :height, :center, :bottom, :top,
13
+ :angle_center, :angle_top, :angle_bottom,
14
+ :comfortable, :bracket_rating_lb, keyword_init: true)
15
+
16
+ module_function
17
+
18
+ # Width and height of a screen from its diagonal (default 16:9).
19
+ def screen_size(diagonal, aspect = [16, 9])
20
+ raise ArgumentError, "diagonal must be positive" unless diagonal.to_f.positive?
21
+ a, b = aspect
22
+ k = diagonal.to_f / Math.hypot(a, b)
23
+ [a * k, b * k]
24
+ end
25
+
26
+ # mode: :wall keeps the screen center inside 42-48 in starting from eye height.
27
+ # :fireplace puts the TV `gap` inches above a mantel at `mantel` inches.
28
+ def plan(diagonal:, weight_lb:, eye:, distance:, mode: :wall, mantel: 54.0, gap: 6.0)
29
+ raise ArgumentError, "distance must be positive" unless distance.to_f.positive?
30
+ width, height = screen_size(diagonal)
31
+ center = if mode == :fireplace
32
+ mantel + gap + height / 2
33
+ else
34
+ eye.to_f.clamp(WALL_CENTER_RANGE.begin, WALL_CENTER_RANGE.end)
35
+ end
36
+ top = center + height / 2
37
+ bottom = center - height / 2
38
+ ang = ->(y) { Math.atan2(y - eye, distance) * 180.0 / Math::PI }
39
+ Result.new(width: width, height: height, center: center, bottom: bottom, top: top,
40
+ angle_center: ang.(center), angle_top: ang.(top), angle_bottom: ang.(bottom),
41
+ comfortable: ang.(center).abs <= COMFORT_ANGLE,
42
+ bracket_rating_lb: (weight_lb * RATING_FACTOR).ceil)
43
+ end
44
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tv_mount_planner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Santa Clarita TV Mounting
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Small dependency-free Ruby library and command-line tool that turns a
13
+ TV diagonal, seated eye height and seat distance into screen width/height, the screen-center
14
+ height, the vertical viewing angle and a bracket-rating target (1.5x the TV weight).
15
+ Reference ranges follow the guides of Santa Clarita TV Mounting, an independent
16
+ local installer in Santa Clarita, CA. Planning aid only; not a quote or an engineering
17
+ check.
18
+ email:
19
+ - info@santaclaritatvmounting.com
20
+ executables:
21
+ - tv_mount_planner
22
+ extensions: []
23
+ extra_rdoc_files: []
24
+ files:
25
+ - LICENSE
26
+ - README.md
27
+ - exe/tv_mount_planner
28
+ - lib/tv_mount_planner.rb
29
+ - lib/tv_mount_planner/version.rb
30
+ homepage: https://santaclaritatvmounting.com/
31
+ licenses:
32
+ - MIT
33
+ metadata:
34
+ homepage_uri: https://santaclaritatvmounting.com/
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '2.7'
43
+ required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ requirements: []
49
+ rubygems_version: 3.6.7
50
+ specification_version: 4
51
+ summary: Screen size, center height and viewing angle for wall-mounting a TV.
52
+ test_files: []