{"id":41808,"library":"pythagore","title":"pythagore","description":"A JavaScript library for calculating the Pythagorean theorem, version 2.3.0. It provides a class-based API with methods to compute the hypotenuse, adjacent side, and check if a triangle is right-angled. The library supports both object-oriented and functional usage, but it is not actively maintained and lacks ES module support. It is limited to basic trigonometric operations and uses CommonJS syntax, making it suitable only for Node.js environments without modern bundler integration.","status":"active","version":"2.3.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","pythagore","pythagora","librarie","library","module","package","math"],"install":[{"cmd":"npm install pythagore","lang":"bash","label":"npm"},{"cmd":"yarn add pythagore","lang":"bash","label":"yarn"},{"cmd":"pnpm add pythagore","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package uses CommonJS; no default export for ES modules.","wrong":"import Pythagore from 'pythagore';","symbol":"Pythagore","correct":"const Pythagore = require('pythagore');"},{"note":"Methods are instance methods, not static. Must instantiate first.","wrong":"Pythagore.Hypotenus(3,4);","symbol":"instance methods","correct":"const p = new Pythagore(); p.Hypotenus(3,4);"},{"note":"Main entry in package.json may point to non-minified version; minified avoids potential issues.","wrong":"require('pythagore');","symbol":"minified version","correct":"const Pythagore = require('pythagore/Pythagore.min.js');"}],"quickstart":{"code":"const Pythagore = require('pythagore');\nconst p = new Pythagore();\n\n// Calculate hypotenuse\nconst hyp = p.Hypotenus(3, 4);\nconsole.log('Hypotenuse:', hyp); // 5\n\n// Check if triangle is right-angled\nconst isRight = p.IsRectangle(5, 3, 4);\nconsole.log('Is right triangle?', isRight); // true\n\n// Calculate adjacent side\nconst adj = p.AdjacentSide(5, 3);\nconsole.log('Adjacent side:', adj); // 4\n\n// Use constructor parameters\nconst p2 = new Pythagore(3, 4, 5);\nconsole.log('Hypotenuse:', p2.Hypotenus()); // 5","lang":"javascript","description":"Demonstrates creating a Pythagore instance and using its three main methods for hypotenuse, adjacent side, and right triangle verification."},"warnings":[{"fix":"Instantiate with `new Pythagore()` before calling methods.","message":"Methods must be called on an instance; they are not static.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always pass explicit arguments to methods or ensure constructor values are intended for reuse.","message":"Constructor parameters override later method arguments; calling a method with no arguments uses stored values.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use exact method names: Hypotenus, AdjacentSide, IsRectangle, Author.","message":"Method names are case-sensitive and non-standard (e.g., 'Hypotenus' instead of 'Hypotenuse').","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Validate inputs before passing to methods.","message":"No error handling for invalid input (e.g., negative numbers).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2.3.0':11 'activ':50 'adjac':25 'angl':35 'api':18 'base':17 'basic':61 'bundler':77 'calcul':6 'check':28 'class':16 'class-bas':15 'commonj':66 'comput':22 'environ':74 'es':54 'function':44 'hypotenus':24 'integr':78 'javascript':3,79 'lack':53 'librari':4,37,82,83 'limit':59 'maintain':51 'make':68 'math':86 'method':20 'modern':76 'modul':55,84 'node.js':73 'object':41 'object-ori':40 'oper':63 'orient':42 'packag':85 'provid':13 'pythagor':1,80 'pythagora':81 'pythagorean':8 'right':34 'right-angl':33 'side':26 'suitabl':70 'support':38,56 'syntax':67 'theorem':9 'triangl':31 'trigonometr':62 'usag':45 'use':65 'version':10 'without':75","created_at":"2026-06-04T18:54:12.393267+00:00","updated_at":"2026-06-04T18:54:12.393267+00:00","problems":[{"fix":"Create an instance first: const p = new Pythagore(); p.Hypotenus(3,4);","cause":"Calling method on the class instead of an instance.","error":"TypeError: Pythagore.Hypotenus is not a function"},{"fix":"Run `npm install pythagore` and use `const Pythagore = require('pythagore');`","cause":"Package not installed or wrong import path in ES module context.","error":"Cannot find module 'pythagore'"},{"fix":"Use correct capitalization: IsRectangle, Hypotenus, AdjacentSide.","cause":"Method name typo (e.g., 'IsRectangLe' vs 'IsRectangle').","error":"TypeError: p.IsRectangle is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"pythagore","openapi_spec":null,"status_page":null,"smithery":null,"categories":["math"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}