Skip to content

Instantly share code, notes, and snippets.

View MrHuli's full-sized avatar

Ross Hulley MrHuli

View GitHub Profile
View drawline2
drawLine : function( x1, y1, x2, y2 ) {
var x = x1 - x2,
y = y1 - y2,
length = Math.sqrt( ( x * x ) + ( y * y ) ),
angle  = Math.atan2( y2 - y1, x2 - x1 ) * 180 / Math.PI, 
transform = 'rotate(' + angle + 'deg)';
var line = $( '<div>' )
.appendTo( 'body' )
View drawline1
drawLine : function( x1, y1, x2, y2 ) {
var x = x1 - x2,
y = y1 - y2,
length = Math.sqrt( ( x * x ) + ( y * y ) );
}