![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
CosSinCalc is a web application able to calculate the variables of a triangle and even draw it for you!
This is an offline version of the calculator available as a Ruby gem. You can use the included command line utility to generate a PDF page containing all the results, formulae and a drawing of the triangle, or you can include it as a library in your Ruby application and use just the features you care about.
The main features are:
pdflatex
) document containing the calculations, the steps performed and a drawing.For instructions on how to use the command line utility, please run cossincalc --help
after installation.
Basic usage through an irb
console:
>> require 'rubygems'
=> true
>> require 'cossincalc'
=> true
# Pass the known side and angle values to the initialization method as two
# hashes. The valid keys (variable names) are :a, :b and :c.
# It is important that you provide the values as strings as they wouldn't
# be parsed and converted properly, otherwise.
>> triangle = CosSinCalc::Triangle.new({ :a => "3.0", :c => "5" }, { :c => "90" })
=> #<CosSinCalc::Triangle:0x25058e8>
>> triangle.calculate!
=> true
# Fetch angle A, but in radians and unrounded.
>> triangle.angle(:a)
=> 0.643501108793284
# Fetch angle A in degrees and rounded.
>> triangle.humanize.angle(:a)
=> "36.87"
# Change the output precision.
>> triangle.humanize(3).angle(:a)
=> "36.870"
# Fetch another variable (side b).
>> triangle.humanize.side(:b)
=> "4.00"
# There are many available variables:
# altitude(:c), median(:a), angle_bisector(:a), area(), circumference()
The default unit used for angles is degrees, however both radians and gon may be used.
>> triangle = CosSinCalc::Triangle.new({ :a => "3.0", :c => "5" }, { :c => (Math::PI/2).to_s, :unit => :radian })
=> #<CosSinCalc::Triangle:0x25058e8>
>> triangle = CosSinCalc::Triangle.new({ :a => "3.0", :c => "5" }, { :c => "100", :unit => :gon })
=> #<CosSinCalc::Triangle:0x25058e8>
Note that no unit is used for side values as it doesn't matter to the calculation.
>> triangle = ...; triangle.calculate!
=> true
# Save an SVG version of the drawing by initializing a new Drawing
# instance and passing the name of the file to be created to the save_svg
# method.
>> CosSinCalc::Triangle::Drawing.new(triangle.humanize).save_svg('my-vector-drawing')
=> true
# Save a PNG version of the drawing by initializing a new Drawing
# instance and passing the name of the file to be created to the save_png
# method.
# In fact, an SVG file is created first and then converted to a PNG image
# by ImageMagick. Make sure to have ImageMagick installed if you want to
# use this feature.
>> CosSinCalc::Triangle::Drawing.new(triangle.humanize).save_png('my-png-drawing')
=> true
>> triangle = ...; triangle.calculate!
=> true
# Pass the wanted filename to the save_pdf method of the Latex instance.
# Make sure to have a LaTeX distribution installed (as well as the
# amsmath, amsfonts and graphicx packages) if you want to make use
# of this feature.
>> CosSinCalc::Triangle::Formatter::Latex.new(triangle.humanize).save_pdf('my-result-document')
=> true
To install it as a Ruby gem, please run
gem install cossincalc
In order for this to work, you must have Ruby and RubyGems installed.
Feature requests, ideas, questions etc. is recieved at http://getsatisfaction.com/cossincalc.
Bugs should be submitted to the issue tracker.
Copyright (c) 2010-2011 Molte Emil Strange Andersen, released under the MIT license.
FAQs
Unknown package
We found that cossincalc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.