Angle gradient in canvas

A context strokeStyle can be a gradient: // create a gradient gradient = ctx.createLinearGradient(xStart, yStart, xEnd, yEnd); gradient.addColorStop(0.0,”blue”); gradient.addColorStop(1.0,”purple”); // stroke using that gradient ctx.strokeStyle = gradient; Example code and a Demo using a gradient strokeStyle: http://jsfiddle.net/m1erickson/w46ps/ <!doctype html> <html> <head> <link rel=”stylesheet” type=”text/css” media=”all” href=”https://stackoverflow.com/questions/22223950/css/reset.css” /> <!– reset css –> <script type=”text/javascript” src=”http://code.jquery.com/jquery.min.js”></script> <style> … Read more

Determine angle of view of smartphone camera

The Camera.Parameters getHorizontalViewAngle() and getVerticalViewAngle() functions provide you with the base view angles. I say “base”, because these apply only to the Camera itself in an unzoomed state, and the values returned by these functions do not change even when the view angle itself does. Camera.Parameters p = camera.getParameters(); double thetaV = Math.toRadians(p.getVerticalViewAngle()); double thetaH … Read more

How to use 4d rotors

The most common way to represent goemetric algebra multivectors (including rotors) in a computer is via an array of coefficients, one for each canonical form algebra basis element (canonical basis blade) ie. for a 4D basis space you will have a 2^4 dimensional algebra and have 2^4 dimensional array of coefficients. An alternate but probably … Read more