The function's parameters are float as stated in the android documentation but then why does the following not work:
<LinearLayout
android:orientation="vertical"
android:layout_width="4sp"
android:layout_height="280sp"
android:background="#F44336"
android:rotationX="45.0"
android:id="@+id/Dstrike1"/>
This just displays the original line in the centre of the parent view.

Although to obtain a diagonal line on the screen android.animation can be used, is there a simpler method?